diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-mgmt-azurestackhci/CHANGELOG.md index 402af01a7e65..f5984ff44e0a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/CHANGELOG.md @@ -1,5 +1,41 @@ # Release History +## 8.1.0 (2026-05-15) + +### Features Added + + - Client `AzureStackHCIClient` added operation group `update_summaries_operation_group` + - Model `Cluster` added property `kind` + - Model `ClusterProperties` added property `billing_properties` + - Model `ClusterProperties` added property `storage_type` + - Model `DeploymentSettingHostNetwork` added property `san_networks` + - Model `HciReportedProperties` added property `last_sync_timestamp` + - Model `HciStorageProfile` added property `disks` + - Model `PerNodeRemoteSupportSession` added property `transcript_location` + - Model `RemoteSupportProperties` added property `remote_support_provisioning_state` + - Model `ReportedProperties` added property `last_sync_timestamp` + - Enum `State` added member `HEALTH_CHECK_EXPIRED` + - Enum `State` added member `PENDING_OEM_VALIDATION` + - Model `Storage` added property `storage_type` + - Model `Storage` added property `s2_d` + - Model `Storage` added property `san` + - Added model `CheckUpdatesRequest` + - Added model `ClusterBillingProperties` + - Added model `EdgeDeviceDisks` + - Added model `NextBillingModel` + - Added enum `OverprovisioningRatio` + - Added enum `RemoteSupportProvisioningState` + - Added model `SanAdapterIPConfig` + - Added model `SanAdapterProperties` + - Added model `SanClusterNetworkConfig` + - Added model `SanNetworks` + - Added model `StorageS2dConfig` + - Added model `StorageSanConfig` + - Added enum `StorageType` + - Added enum `VolumeType` + - Model `UpdatesOperations` added method `begin_prepare` + - Added model `UpdateSummariesOperationGroupOperations` + ## 8.1.0b1 (2026-04-13) ### Features Added diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/README.md b/sdk/azurestackhci/azure-mgmt-azurestackhci/README.md index 608a7ffd35c8..2d8989f360eb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Azure Stack HCI Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/_metadata.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/_metadata.json index 3e834f652a3f..6b2118ab9764 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/_metadata.json +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/_metadata.json @@ -1,10 +1,10 @@ { - "apiVersion": "2026-04-01-preview", + "apiVersion": "2026-04-30", "apiVersions": { - "Microsoft.AzureStackHCI": "2026-04-01-preview" + "Microsoft.AzureStackHCI": "2026-04-30" }, - "commit": "c22e8792df237fd9afe601d69e305504679c42af", + "commit": "675a8ce1a1d7489731bc8bd05d8d3e7d865434e0", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI", - "emitterVersion": "0.61.3" + "emitterVersion": "0.62.1" } \ No newline at end of file diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/apiview-properties.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/apiview-properties.json index f125bf494b7a..451f97b278f4 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/apiview-properties.json +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/apiview-properties.json @@ -12,28 +12,18 @@ "azure.mgmt.azurestackhci.models.ArcSettingsPatchProperties": "Microsoft.AzureStackHCI.ArcSettingsPatchProperties", "azure.mgmt.azurestackhci.models.AssemblyInfo": "Microsoft.AzureStackHCI.AssemblyInfo", "azure.mgmt.azurestackhci.models.AssemblyInfoPayload": "Microsoft.AzureStackHCI.AssemblyInfoPayload", - "azure.mgmt.azurestackhci.models.ChangeRingRequest": "Microsoft.AzureStackHCI.ChangeRingRequest", - "azure.mgmt.azurestackhci.models.ChangeRingRequestProperties": "Microsoft.AzureStackHCI.ChangeRingRequestProperties", "azure.mgmt.azurestackhci.models.CheckUpdatesRequest": "Microsoft.AzureStackHCI.CheckUpdatesRequest", - "azure.mgmt.azurestackhci.models.ClaimDeviceRequest": "Microsoft.AzureStackHCI.ClaimDeviceRequest", "azure.mgmt.azurestackhci.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", "azure.mgmt.azurestackhci.models.Cluster": "Microsoft.AzureStackHCI.Cluster", "azure.mgmt.azurestackhci.models.ClusterBillingProperties": "Microsoft.AzureStackHCI.ClusterBillingProperties", "azure.mgmt.azurestackhci.models.ClusterDesiredProperties": "Microsoft.AzureStackHCI.ClusterDesiredProperties", "azure.mgmt.azurestackhci.models.ClusterIdentityResponse": "Microsoft.AzureStackHCI.ClusterIdentityResponse", "azure.mgmt.azurestackhci.models.ClusterIdentityResponseProperties": "Microsoft.AzureStackHCI.ClusterIdentityResponseProperties", - "azure.mgmt.azurestackhci.models.ClusterJob": "Microsoft.AzureStackHCI.ClusterJob", - "azure.mgmt.azurestackhci.models.ClusterJobProperties": "Microsoft.AzureStackHCI.ClusterJobProperties", "azure.mgmt.azurestackhci.models.ClusterNode": "Microsoft.AzureStackHCI.ClusterNode", "azure.mgmt.azurestackhci.models.ClusterPatch": "Microsoft.AzureStackHCI.ClusterPatch", "azure.mgmt.azurestackhci.models.ClusterPatchProperties": "Microsoft.AzureStackHCI.ClusterPatchProperties", "azure.mgmt.azurestackhci.models.ClusterProperties": "Microsoft.AzureStackHCI.ClusterProperties", "azure.mgmt.azurestackhci.models.ClusterReportedProperties": "Microsoft.AzureStackHCI.ClusterReportedProperties", - "azure.mgmt.azurestackhci.models.SdnProperties": "Microsoft.AzureStackHCI.SdnProperties", - "azure.mgmt.azurestackhci.models.ClusterSdnProperties": "Microsoft.AzureStackHCI.ClusterSdnProperties", - "azure.mgmt.azurestackhci.models.ConfidentialVmProfile": "Microsoft.AzureStackHCI.ConfidentialVmProfile", - "azure.mgmt.azurestackhci.models.ConfidentialVmProperties": "Microsoft.AzureStackHCI.ConfidentialVmProperties", - "azure.mgmt.azurestackhci.models.ContentPayload": "Microsoft.AzureStackHCI.ContentPayload", "azure.mgmt.azurestackhci.models.DefaultExtensionDetails": "Microsoft.AzureStackHCI.DefaultExtensionDetails", "azure.mgmt.azurestackhci.models.DeploymentCluster": "Microsoft.AzureStackHCI.DeploymentCluster", "azure.mgmt.azurestackhci.models.DeploymentConfiguration": "Microsoft.AzureStackHCI.DeploymentConfiguration", @@ -49,15 +39,7 @@ "azure.mgmt.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides": "Microsoft.AzureStackHCI.DeploymentSettingVirtualSwitchConfigurationOverrides", "azure.mgmt.azurestackhci.models.DeploymentStep": "Microsoft.AzureStackHCI.DeploymentStep", "azure.mgmt.azurestackhci.models.DeviceConfiguration": "Microsoft.AzureStackHCI.DeviceConfiguration", - "azure.mgmt.azurestackhci.models.DeviceDetail": "Microsoft.AzureStackHCI.DeviceDetail", - "azure.mgmt.azurestackhci.models.DevicePool": "Microsoft.AzureStackHCI.DevicePool", - "azure.mgmt.azurestackhci.models.DevicePoolPatch": "Microsoft.AzureStackHCI.DevicePoolPatch", - "azure.mgmt.azurestackhci.models.DevicePoolProperties": "Microsoft.AzureStackHCI.DevicePoolProperties", "azure.mgmt.azurestackhci.models.DnsZones": "Microsoft.AzureStackHCI.DnsZones", - "azure.mgmt.azurestackhci.models.EdgeMachineJobProperties": "Microsoft.AzureStackHCI.EdgeMachineJobProperties", - "azure.mgmt.azurestackhci.models.DownloadOsJobProperties": "Microsoft.AzureStackHCI.DownloadOsJobProperties", - "azure.mgmt.azurestackhci.models.DownloadOsProfile": "Microsoft.AzureStackHCI.DownloadOsProfile", - "azure.mgmt.azurestackhci.models.DownloadRequest": "Microsoft.AzureStackHCI.DownloadRequest", "azure.mgmt.azurestackhci.models.EceActionStatus": "Microsoft.AzureStackHCI.EceActionStatus", "azure.mgmt.azurestackhci.models.EceDeploymentSecrets": "Microsoft.AzureStackHCI.EceDeploymentSecrets", "azure.mgmt.azurestackhci.models.EceReportedProperties": "Microsoft.AzureStackHCI.EceReportedProperties", @@ -66,18 +48,6 @@ "azure.mgmt.azurestackhci.models.EdgeDeviceDisks": "Microsoft.AzureStackHCI.EdgeDeviceDisks", "azure.mgmt.azurestackhci.models.EdgeDeviceJob": "Microsoft.AzureStackHCI.EdgeDeviceJob", "azure.mgmt.azurestackhci.models.EdgeDeviceProperties": "Microsoft.AzureStackHCI.EdgeDeviceProperties", - "azure.mgmt.azurestackhci.models.EdgeMachine": "Microsoft.AzureStackHCI.EdgeMachine", - "azure.mgmt.azurestackhci.models.EdgeMachineCollectLogJobProperties": "Microsoft.AzureStackHCI.EdgeMachineCollectLogJobProperties", - "azure.mgmt.azurestackhci.models.EdgeMachineCollectLogJobReportedProperties": "Microsoft.AzureStackHCI.EdgeMachineCollectLogJobReportedProperties", - "azure.mgmt.azurestackhci.models.EdgeMachineJob": "Microsoft.AzureStackHCI.EdgeMachineJob", - "azure.mgmt.azurestackhci.models.EdgeMachineNetworkProfile": "Microsoft.AzureStackHCI.EdgeMachineNetworkProfile", - "azure.mgmt.azurestackhci.models.EdgeMachineNicDetail": "Microsoft.AzureStackHCI.EdgeMachineNicDetail", - "azure.mgmt.azurestackhci.models.EdgeMachinePatch": "Microsoft.AzureStackHCI.EdgeMachinePatch", - "azure.mgmt.azurestackhci.models.EdgeMachineProperties": "Microsoft.AzureStackHCI.EdgeMachineProperties", - "azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportJobProperties": "Microsoft.AzureStackHCI.EdgeMachineRemoteSupportJobProperties", - "azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportJobReportedProperties": "Microsoft.AzureStackHCI.EdgeMachineRemoteSupportJobReportedProperties", - "azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportNodeSettings": "Microsoft.AzureStackHCI.EdgeMachineRemoteSupportNodeSettings", - "azure.mgmt.azurestackhci.models.EdgeMachineReportedProperties": "Microsoft.AzureStackHCI.EdgeMachineReportedProperties", "azure.mgmt.azurestackhci.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.azurestackhci.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.azurestackhci.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", @@ -91,11 +61,8 @@ "azure.mgmt.azurestackhci.models.ExtensionProfile": "Microsoft.AzureStackHCI.ExtensionProfile", "azure.mgmt.azurestackhci.models.ExtensionProperties": "Microsoft.AzureStackHCI.ExtensionProperties", "azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters": "Microsoft.AzureStackHCI.ExtensionUpgradeParameters", - "azure.mgmt.azurestackhci.models.HardwareProfile": "Microsoft.AzureStackHCI.HardwareProfile", "azure.mgmt.azurestackhci.models.HciEdgeDeviceJobProperties": "Microsoft.AzureStackHCI.HciEdgeDeviceJobProperties", "azure.mgmt.azurestackhci.models.HciCollectLogJobProperties": "Microsoft.AzureStackHCI.HciCollectLogJobProperties", - "azure.mgmt.azurestackhci.models.HciConfigureCvmJobProperties": "Microsoft.AzureStackHCI.HciConfigureCvmJobProperties", - "azure.mgmt.azurestackhci.models.HciConfigureSdnIntegrationJobProperties": "Microsoft.AzureStackHCI.HciConfigureSdnIntegrationJobProperties", "azure.mgmt.azurestackhci.models.HciEdgeDevice": "Microsoft.AzureStackHCI.HciEdgeDevice", "azure.mgmt.azurestackhci.models.HciEdgeDeviceAdapterPropertyOverrides": "Microsoft.AzureStackHCI.HciEdgeDeviceAdapterPropertyOverrides", "azure.mgmt.azurestackhci.models.HciEdgeDeviceArcExtension": "Microsoft.AzureStackHCI.HciEdgeDeviceArcExtension", @@ -115,14 +82,9 @@ "azure.mgmt.azurestackhci.models.HciReportedProperties": "Microsoft.AzureStackHCI.HciReportedProperties", "azure.mgmt.azurestackhci.models.HciStorageProfile": "Microsoft.AzureStackHCI.HciStorageProfile", "azure.mgmt.azurestackhci.models.HciValidationFailureDetail": "Microsoft.AzureStackHCI.HciValidationFailureDetail", - "azure.mgmt.azurestackhci.models.IgvmStatusDetail": "Microsoft.AzureStackHCI.IgvmStatusDetail", "azure.mgmt.azurestackhci.models.InfrastructureNetwork": "Microsoft.AzureStackHCI.InfrastructureNetwork", - "azure.mgmt.azurestackhci.models.IpAddressRange": "Microsoft.AzureStackHCI.IpAddressRange", "azure.mgmt.azurestackhci.models.IpPools": "Microsoft.AzureStackHCI.IpPools", "azure.mgmt.azurestackhci.models.IsolatedVmAttestationConfiguration": "Microsoft.AzureStackHCI.IsolatedVmAttestationConfiguration", - "azure.mgmt.azurestackhci.models.JobReportedProperties": "Microsoft.AzureStackHCI.JobReportedProperties", - "azure.mgmt.azurestackhci.models.KubernetesVersion": "Microsoft.AzureStackHCI.KubernetesVersion", - "azure.mgmt.azurestackhci.models.KubernetesVersionProperties": "Microsoft.AzureStackHCI.KubernetesVersionProperties", "azure.mgmt.azurestackhci.models.LocalAvailabilityZones": "Microsoft.AzureStackHCI.LocalAvailabilityZones", "azure.mgmt.azurestackhci.models.LogCollectionError": "Microsoft.AzureStackHCI.LogCollectionError", "azure.mgmt.azurestackhci.models.LogCollectionJobSession": "Microsoft.AzureStackHCI.LogCollectionJobSession", @@ -132,48 +94,27 @@ "azure.mgmt.azurestackhci.models.LogCollectionRequestProperties": "Microsoft.AzureStackHCI.LogCollectionRequestProperties", "azure.mgmt.azurestackhci.models.LogCollectionSession": "Microsoft.AzureStackHCI.LogCollectionSession", "azure.mgmt.azurestackhci.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", - "azure.mgmt.azurestackhci.models.NetworkAdapter": "Microsoft.AzureStackHCI.NetworkAdapter", - "azure.mgmt.azurestackhci.models.NetworkConfiguration": "Microsoft.AzureStackHCI.NetworkConfiguration", "azure.mgmt.azurestackhci.models.NetworkController": "Microsoft.AzureStackHCI.NetworkController", "azure.mgmt.azurestackhci.models.NextBillingModel": "Microsoft.AzureStackHCI.NextBillingModel", "azure.mgmt.azurestackhci.models.NicDetail": "Microsoft.AzureStackHCI.NicDetail", "azure.mgmt.azurestackhci.models.Observability": "Microsoft.AzureStackHCI.Observability", "azure.mgmt.azurestackhci.models.Offer": "Microsoft.AzureStackHCI.Offer", "azure.mgmt.azurestackhci.models.OfferProperties": "Microsoft.AzureStackHCI.OfferProperties", - "azure.mgmt.azurestackhci.models.OnboardingConfiguration": "Microsoft.AzureStackHCI.OnboardingConfiguration", "azure.mgmt.azurestackhci.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", - "azure.mgmt.azurestackhci.models.OperationDetail": "Microsoft.AzureStackHCI.OperationDetail", "azure.mgmt.azurestackhci.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", "azure.mgmt.azurestackhci.models.OptionalServices": "Microsoft.AzureStackHCI.OptionalServices", - "azure.mgmt.azurestackhci.models.OsImage": "Microsoft.AzureStackHCI.OsImage", - "azure.mgmt.azurestackhci.models.OsImageProperties": "Microsoft.AzureStackHCI.OsImageProperties", - "azure.mgmt.azurestackhci.models.OsProfile": "Microsoft.AzureStackHCI.OsProfile", - "azure.mgmt.azurestackhci.models.OsProvisionProfile": "Microsoft.AzureStackHCI.OsProvisionProfile", - "azure.mgmt.azurestackhci.models.OwnershipVoucherDetails": "Microsoft.AzureStackHCI.OwnershipVoucherDetails", - "azure.mgmt.azurestackhci.models.OwnershipVoucherValidationDetails": "Microsoft.AzureStackHCI.OwnershipVoucherValidationDetails", "azure.mgmt.azurestackhci.models.PackageVersionInfo": "Microsoft.AzureStackHCI.PackageVersionInfo", "azure.mgmt.azurestackhci.models.PasswordCredential": "Microsoft.AzureStackHCI.PasswordCredential", "azure.mgmt.azurestackhci.models.PerNodeExtensionState": "Microsoft.AzureStackHCI.PerNodeExtensionState", "azure.mgmt.azurestackhci.models.PerNodeRemoteSupportSession": "Microsoft.AzureStackHCI.PerNodeRemoteSupportSession", "azure.mgmt.azurestackhci.models.PerNodeState": "Microsoft.AzureStackHCI.PerNodeState", "azure.mgmt.azurestackhci.models.PhysicalNodes": "Microsoft.AzureStackHCI.PhysicalNodes", - "azure.mgmt.azurestackhci.models.PlatformPayload": "Microsoft.AzureStackHCI.PlatformPayload", - "azure.mgmt.azurestackhci.models.PlatformUpdate": "Microsoft.AzureStackHCI.PlatformUpdate", - "azure.mgmt.azurestackhci.models.PlatformUpdateDetails": "Microsoft.AzureStackHCI.PlatformUpdateDetails", - "azure.mgmt.azurestackhci.models.PlatformUpdateProperties": "Microsoft.AzureStackHCI.PlatformUpdateProperties", "azure.mgmt.azurestackhci.models.PrecheckResult": "Microsoft.AzureStackHCI.PrecheckResult", "azure.mgmt.azurestackhci.models.PrecheckResultTags": "Microsoft.AzureStackHCI.PrecheckResultTags", - "azure.mgmt.azurestackhci.models.ProvisioningDetails": "Microsoft.AzureStackHCI.ProvisioningDetails", - "azure.mgmt.azurestackhci.models.ProvisioningRequest": "Microsoft.AzureStackHCI.ProvisioningRequest", - "azure.mgmt.azurestackhci.models.ProvisionOsJobProperties": "Microsoft.AzureStackHCI.ProvisionOsJobProperties", - "azure.mgmt.azurestackhci.models.ProvisionOsReportedProperties": "Microsoft.AzureStackHCI.ProvisionOsReportedProperties", - "azure.mgmt.azurestackhci.models.Publisher": "Microsoft.AzureStackHCI.Publisher", - "azure.mgmt.azurestackhci.models.PublisherProperties": "Microsoft.AzureStackHCI.PublisherProperties", "azure.mgmt.azurestackhci.models.QosPolicyOverrides": "Microsoft.AzureStackHCI.QosPolicyOverrides", "azure.mgmt.azurestackhci.models.RawCertificateData": "Microsoft.AzureStackHCI.RawCertificateData", "azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest": "Microsoft.AzureStackHCI.ReconcileArcSettingsRequest", "azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequestProperties": "Microsoft.AzureStackHCI.ReconcileArcSettingsRequestProperties", - "azure.mgmt.azurestackhci.models.ReleaseDeviceRequest": "Microsoft.AzureStackHCI.ReleaseDeviceRequest", "azure.mgmt.azurestackhci.models.RemoteSupportJobNodeSettings": "Microsoft.AzureStackHCI.RemoteSupportJobNodeSettings", "azure.mgmt.azurestackhci.models.RemoteSupportJobReportedProperties": "Microsoft.AzureStackHCI.RemoteSupportJobReportedProperties", "azure.mgmt.azurestackhci.models.RemoteSupportNodeSettings": "Microsoft.AzureStackHCI.RemoteSupportNodeSettings", @@ -198,7 +139,6 @@ "azure.mgmt.azurestackhci.models.SecurityProperties": "Microsoft.AzureStackHCI.SecurityProperties", "azure.mgmt.azurestackhci.models.SecuritySetting": "Microsoft.AzureStackHCI.SecuritySetting", "azure.mgmt.azurestackhci.models.ServiceConfiguration": "Microsoft.AzureStackHCI.ServiceConfiguration", - "azure.mgmt.azurestackhci.models.SiteDetails": "Microsoft.AzureStackHCI.SiteDetails", "azure.mgmt.azurestackhci.models.Sku": "Microsoft.AzureStackHCI.Sku", "azure.mgmt.azurestackhci.models.SkuMappings": "Microsoft.AzureStackHCI.SkuMappings", "azure.mgmt.azurestackhci.models.SkuProperties": "Microsoft.AzureStackHCI.SkuProperties", @@ -207,18 +147,12 @@ "azure.mgmt.azurestackhci.models.SoftwareAssuranceProperties": "Microsoft.AzureStackHCI.SoftwareAssuranceProperties", "azure.mgmt.azurestackhci.models.Step": "Microsoft.AzureStackHCI.Step", "azure.mgmt.azurestackhci.models.Storage": "Microsoft.AzureStackHCI.Storage", - "azure.mgmt.azurestackhci.models.StorageConfiguration": "Microsoft.AzureStackHCI.StorageConfiguration", - "azure.mgmt.azurestackhci.models.StorageProfile": "Microsoft.AzureStackHCI.StorageProfile", "azure.mgmt.azurestackhci.models.StorageS2dConfig": "Microsoft.AzureStackHCI.StorageS2dConfig", "azure.mgmt.azurestackhci.models.StorageSanConfig": "Microsoft.AzureStackHCI.StorageSanConfig", "azure.mgmt.azurestackhci.models.SwitchDetail": "Microsoft.AzureStackHCI.SwitchDetail", "azure.mgmt.azurestackhci.models.SwitchExtension": "Microsoft.AzureStackHCI.SwitchExtension", "azure.mgmt.azurestackhci.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", - "azure.mgmt.azurestackhci.models.TargetDeviceConfiguration": "Microsoft.AzureStackHCI.TargetDeviceConfiguration", - "azure.mgmt.azurestackhci.models.TimeConfiguration": "Microsoft.AzureStackHCI.TimeConfiguration", "azure.mgmt.azurestackhci.models.Update": "Microsoft.AzureStackHCI.Update", - "azure.mgmt.azurestackhci.models.UpdateContent": "Microsoft.AzureStackHCI.UpdateContent", - "azure.mgmt.azurestackhci.models.UpdateContentProperties": "Microsoft.AzureStackHCI.UpdateContentProperties", "azure.mgmt.azurestackhci.models.UpdatePrerequisite": "Microsoft.AzureStackHCI.UpdatePrerequisite", "azure.mgmt.azurestackhci.models.UpdateProperties": "Microsoft.AzureStackHCI.UpdateProperties", "azure.mgmt.azurestackhci.models.UpdateRun": "Microsoft.AzureStackHCI.UpdateRun", @@ -228,7 +162,6 @@ "azure.mgmt.azurestackhci.models.UpdateSummariesProperties": "Microsoft.AzureStackHCI.UpdateSummariesProperties", "azure.mgmt.azurestackhci.models.UploadCertificateRequest": "Microsoft.AzureStackHCI.UploadCertificateRequest", "azure.mgmt.azurestackhci.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", - "azure.mgmt.azurestackhci.models.UserDetails": "Microsoft.AzureStackHCI.UserDetails", "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe": "Microsoft.AzureStackHCI.ValidatedSolutionRecipe", "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeCapabilities": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeCapabilities", "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeCapability": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeCapability", @@ -238,14 +171,11 @@ "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeContent": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeContent", "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeInfo": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeInfo", "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeProperties": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeProperties", - "azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest": "Microsoft.AzureStackHCI.ValidateOwnershipVouchersRequest", - "azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse": "Microsoft.AzureStackHCI.ValidateOwnershipVouchersResponse", "azure.mgmt.azurestackhci.models.ValidateRequest": "Microsoft.AzureStackHCI.ValidateRequest", "azure.mgmt.azurestackhci.models.ValidateResponse": "Microsoft.AzureStackHCI.ValidateResponse", - "azure.mgmt.azurestackhci.models.WebProxyConfiguration": "Microsoft.AzureStackHCI.WebProxyConfiguration", - "azure.mgmt.azurestackhci.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", "azure.mgmt.azurestackhci.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", "azure.mgmt.azurestackhci.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.azurestackhci.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", "azure.mgmt.azurestackhci.models.ProvisioningState": "Microsoft.AzureStackHCI.ProvisioningState", "azure.mgmt.azurestackhci.models.ArcSettingAggregateState": "Microsoft.AzureStackHCI.ArcSettingAggregateState", "azure.mgmt.azurestackhci.models.NodeArcState": "Microsoft.AzureStackHCI.NodeArcState", @@ -267,10 +197,6 @@ "azure.mgmt.azurestackhci.models.HardwareClass": "Microsoft.AzureStackHCI.HardwareClass", "azure.mgmt.azurestackhci.models.SecretsType": "Microsoft.AzureStackHCI.SecretsType", "azure.mgmt.azurestackhci.models.ClusterPattern": "Microsoft.AzureStackHCI.ClusterPattern", - "azure.mgmt.azurestackhci.models.ConfidentialVmIntent": "Microsoft.AzureStackHCI.ConfidentialVmIntent", - "azure.mgmt.azurestackhci.models.ConfidentialVmStatus": "Microsoft.AzureStackHCI.ConfidentialVmStatus", - "azure.mgmt.azurestackhci.models.SdnStatus": "Microsoft.AzureStackHCI.SdnStatus", - "azure.mgmt.azurestackhci.models.SdnIntegrationIntent": "Microsoft.AzureStackHCI.SdnIntegrationIntent", "azure.mgmt.azurestackhci.models.IdentityProvider": "Microsoft.AzureStackHCI.IdentityProvider", "azure.mgmt.azurestackhci.models.StorageType": "Microsoft.AzureStackHCI.StorageType", "azure.mgmt.azurestackhci.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", @@ -289,7 +215,6 @@ "azure.mgmt.azurestackhci.models.DeviceState": "Microsoft.AzureStackHCI.DeviceState", "azure.mgmt.azurestackhci.models.ArcExtensionState": "Microsoft.AzureStackHCI.ArcExtensionState", "azure.mgmt.azurestackhci.models.ExtensionManagedBy": "Microsoft.AzureStackHCI.ExtensionManagedBy", - "azure.mgmt.azurestackhci.models.IgvmStatus": "Microsoft.AzureStackHCI.IgvmStatus", "azure.mgmt.azurestackhci.models.RdmaCapability": "Microsoft.AzureStackHCI.RdmaCapability", "azure.mgmt.azurestackhci.models.ExtensionAggregateState": "Microsoft.AzureStackHCI.ExtensionAggregateState", "azure.mgmt.azurestackhci.models.NodeExtensionState": "Microsoft.AzureStackHCI.NodeExtensionState", @@ -302,33 +227,7 @@ "azure.mgmt.azurestackhci.models.HealthState": "Microsoft.AzureStackHCI.HealthState", "azure.mgmt.azurestackhci.models.Severity": "Microsoft.AzureStackHCI.Severity", "azure.mgmt.azurestackhci.models.AvailabilityType": "Microsoft.AzureStackHCI.AvailabilityType", - "azure.mgmt.azurestackhci.models.EdgeMachineKind": "Microsoft.AzureStackHCI.EdgeMachineKind", - "azure.mgmt.azurestackhci.models.IpAssignmentType": "Microsoft.AzureStackHCI.IpAssignmentType", - "azure.mgmt.azurestackhci.models.OwnerKeyType": "Microsoft.AzureStackHCI.OwnerKeyType", - "azure.mgmt.azurestackhci.models.OwnershipVoucherValidationStatus": "Microsoft.AzureStackHCI.OwnershipVoucherValidationStatus", - "azure.mgmt.azurestackhci.models.OSOperationType": "Microsoft.AzureStackHCI.OSOperationType", - "azure.mgmt.azurestackhci.models.SecretType": "Microsoft.AzureStackHCI.SecretType", - "azure.mgmt.azurestackhci.models.EdgeMachineState": "Microsoft.AzureStackHCI.EdgeMachineState", - "azure.mgmt.azurestackhci.models.EdgeMachineConnectivityStatus": "Microsoft.AzureStackHCI.EdgeMachineConnectivityStatus", - "azure.mgmt.azurestackhci.models.EdgeMachineJobType": "Microsoft.AzureStackHCI.EdgeMachineJobType", - "azure.mgmt.azurestackhci.models.ProvisioningOsType": "Microsoft.AzureStackHCI.ProvisioningOsType", - "azure.mgmt.azurestackhci.models.OnboardingResourceType": "Microsoft.AzureStackHCI.OnboardingResourceType", - "azure.mgmt.azurestackhci.models.HciJobType": "Microsoft.AzureStackHCI.HciJobType", "azure.mgmt.azurestackhci.models.UpdateSummariesPropertiesState": "Microsoft.AzureStackHCI.UpdateSummariesPropertiesState", - "azure.mgmt.azurestackhci.operations.KubernetesVersionsOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.KubernetesVersions.listBySubscriptionLocationResource", - "azure.mgmt.azurestackhci.aio.operations.KubernetesVersionsOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.KubernetesVersions.listBySubscriptionLocationResource", - "azure.mgmt.azurestackhci.operations.PlatformUpdatesOperations.get": "Microsoft.AzureStackHCI.PlatformUpdates.get", - "azure.mgmt.azurestackhci.aio.operations.PlatformUpdatesOperations.get": "Microsoft.AzureStackHCI.PlatformUpdates.get", - "azure.mgmt.azurestackhci.operations.PlatformUpdatesOperations.list": "Microsoft.AzureStackHCI.PlatformUpdates.list", - "azure.mgmt.azurestackhci.aio.operations.PlatformUpdatesOperations.list": "Microsoft.AzureStackHCI.PlatformUpdates.list", - "azure.mgmt.azurestackhci.operations.OsImagesOperations.get": "Microsoft.AzureStackHCI.OsImages.get", - "azure.mgmt.azurestackhci.aio.operations.OsImagesOperations.get": "Microsoft.AzureStackHCI.OsImages.get", - "azure.mgmt.azurestackhci.operations.OsImagesOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.OsImages.listBySubscriptionLocationResource", - "azure.mgmt.azurestackhci.aio.operations.OsImagesOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.OsImages.listBySubscriptionLocationResource", - "azure.mgmt.azurestackhci.operations.UpdateContentsOperations.get": "Microsoft.AzureStackHCI.UpdateContents.get", - "azure.mgmt.azurestackhci.aio.operations.UpdateContentsOperations.get": "Microsoft.AzureStackHCI.UpdateContents.get", - "azure.mgmt.azurestackhci.operations.UpdateContentsOperations.list": "Microsoft.AzureStackHCI.UpdateContents.list", - "azure.mgmt.azurestackhci.aio.operations.UpdateContentsOperations.list": "Microsoft.AzureStackHCI.UpdateContents.list", "azure.mgmt.azurestackhci.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.azurestackhci.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.get": "Microsoft.AzureStackHCI.ArcSettings.get", @@ -377,8 +276,6 @@ "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_create_identity": "Microsoft.AzureStackHCI.Clusters.createIdentity", "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_extend_software_assurance_benefit": "Microsoft.AzureStackHCI.Clusters.extendSoftwareAssuranceBenefit", "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_extend_software_assurance_benefit": "Microsoft.AzureStackHCI.Clusters.extendSoftwareAssuranceBenefit", - "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_change_ring": "Microsoft.AzureStackHCI.Clusters.changeRing", - "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_change_ring": "Microsoft.AzureStackHCI.Clusters.changeRing", "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_trigger_log_collection": "Microsoft.AzureStackHCI.Clusters.triggerLogCollection", "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_trigger_log_collection": "Microsoft.AzureStackHCI.Clusters.triggerLogCollection", "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_configure_remote_support": "Microsoft.AzureStackHCI.Clusters.configureRemoteSupport", @@ -421,10 +318,6 @@ "azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations.list_by_arc_setting": "Microsoft.AzureStackHCI.Extensions.listByArcSetting", "azure.mgmt.azurestackhci.operations.ExtensionsOperations.begin_upgrade": "Microsoft.AzureStackHCI.Extensions.upgrade", "azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations.begin_upgrade": "Microsoft.AzureStackHCI.Extensions.upgrade", - "azure.mgmt.azurestackhci.operations.PublishersOperations.get": "Microsoft.AzureStackHCI.Publishers.get", - "azure.mgmt.azurestackhci.aio.operations.PublishersOperations.get": "Microsoft.AzureStackHCI.Publishers.get", - "azure.mgmt.azurestackhci.operations.PublishersOperations.list_by_cluster": "Microsoft.AzureStackHCI.Publishers.listByCluster", - "azure.mgmt.azurestackhci.aio.operations.PublishersOperations.list_by_cluster": "Microsoft.AzureStackHCI.Publishers.listByCluster", "azure.mgmt.azurestackhci.operations.SecuritySettingsOperations.get": "Microsoft.AzureStackHCI.SecuritySettings.get", "azure.mgmt.azurestackhci.aio.operations.SecuritySettingsOperations.get": "Microsoft.AzureStackHCI.SecuritySettings.get", "azure.mgmt.azurestackhci.operations.SecuritySettingsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.SecuritySettings.createOrUpdate", @@ -465,52 +358,6 @@ "azure.mgmt.azurestackhci.aio.operations.ValidatedSolutionRecipesOperations.get": "Microsoft.AzureStackHCI.ValidatedSolutionRecipes.get", "azure.mgmt.azurestackhci.operations.ValidatedSolutionRecipesOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.ValidatedSolutionRecipes.listBySubscriptionLocationResource", "azure.mgmt.azurestackhci.aio.operations.ValidatedSolutionRecipesOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.ValidatedSolutionRecipes.listBySubscriptionLocationResource", - "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.get": "Microsoft.AzureStackHCI.EdgeMachines.get", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.get": "Microsoft.AzureStackHCI.EdgeMachines.get", - "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeMachines.createOrUpdate", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeMachines.createOrUpdate", - "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.begin_update": "Microsoft.AzureStackHCI.EdgeMachines.update", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.begin_update": "Microsoft.AzureStackHCI.EdgeMachines.update", - "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeMachines.delete", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeMachines.delete", - "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.list_by_resource_group": "Microsoft.AzureStackHCI.EdgeMachines.listByResourceGroup", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.list_by_resource_group": "Microsoft.AzureStackHCI.EdgeMachines.listByResourceGroup", - "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.list_by_subscription": "Microsoft.AzureStackHCI.EdgeMachines.listBySubscription", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.list_by_subscription": "Microsoft.AzureStackHCI.EdgeMachines.listBySubscription", - "azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations.get": "Microsoft.AzureStackHCI.EdgeMachineJobs.get", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations.get": "Microsoft.AzureStackHCI.EdgeMachineJobs.get", - "azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeMachineJobs.createOrUpdate", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeMachineJobs.createOrUpdate", - "azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeMachineJobs.delete", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeMachineJobs.delete", - "azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations.list": "Microsoft.AzureStackHCI.EdgeMachineJobs.list", - "azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations.list": "Microsoft.AzureStackHCI.EdgeMachineJobs.list", - "azure.mgmt.azurestackhci.operations.OwnershipVouchersOperations.validate": "Microsoft.AzureStackHCI.OwnershipVouchers.validate", - "azure.mgmt.azurestackhci.aio.operations.OwnershipVouchersOperations.validate": "Microsoft.AzureStackHCI.OwnershipVouchers.validate", - "azure.mgmt.azurestackhci.operations.ClusterJobsOperations.get": "Microsoft.AzureStackHCI.ClusterJobs.get", - "azure.mgmt.azurestackhci.aio.operations.ClusterJobsOperations.get": "Microsoft.AzureStackHCI.ClusterJobs.get", - "azure.mgmt.azurestackhci.operations.ClusterJobsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.ClusterJobs.createOrUpdate", - "azure.mgmt.azurestackhci.aio.operations.ClusterJobsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.ClusterJobs.createOrUpdate", - "azure.mgmt.azurestackhci.operations.ClusterJobsOperations.begin_delete": "Microsoft.AzureStackHCI.ClusterJobs.delete", - "azure.mgmt.azurestackhci.aio.operations.ClusterJobsOperations.begin_delete": "Microsoft.AzureStackHCI.ClusterJobs.delete", - "azure.mgmt.azurestackhci.operations.ClusterJobsOperations.list": "Microsoft.AzureStackHCI.ClusterJobs.list", - "azure.mgmt.azurestackhci.aio.operations.ClusterJobsOperations.list": "Microsoft.AzureStackHCI.ClusterJobs.list", - "azure.mgmt.azurestackhci.operations.DevicePoolsOperations.get": "Microsoft.AzureStackHCI.DevicePools.get", - "azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations.get": "Microsoft.AzureStackHCI.DevicePools.get", - "azure.mgmt.azurestackhci.operations.DevicePoolsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.DevicePools.createOrUpdate", - "azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.DevicePools.createOrUpdate", - "azure.mgmt.azurestackhci.operations.DevicePoolsOperations.begin_delete": "Microsoft.AzureStackHCI.DevicePools.delete", - "azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations.begin_delete": "Microsoft.AzureStackHCI.DevicePools.delete", - "azure.mgmt.azurestackhci.operations.DevicePoolsOperations.begin_update": "Microsoft.AzureStackHCI.DevicePools.update", - "azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations.begin_update": "Microsoft.AzureStackHCI.DevicePools.update", - "azure.mgmt.azurestackhci.operations.DevicePoolsOperations.list_by_resource_group": "Microsoft.AzureStackHCI.DevicePools.listByResourceGroup", - "azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations.list_by_resource_group": "Microsoft.AzureStackHCI.DevicePools.listByResourceGroup", - "azure.mgmt.azurestackhci.operations.DevicePoolsOperations.list_by_subscription": "Microsoft.AzureStackHCI.DevicePools.listBySubscription", - "azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations.list_by_subscription": "Microsoft.AzureStackHCI.DevicePools.listBySubscription", - "azure.mgmt.azurestackhci.operations.DevicePoolsOperations.begin_claim_devices": "Microsoft.AzureStackHCI.DevicePools.claimDevices", - "azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations.begin_claim_devices": "Microsoft.AzureStackHCI.DevicePools.claimDevices", - "azure.mgmt.azurestackhci.operations.DevicePoolsOperations.begin_release_devices": "Microsoft.AzureStackHCI.DevicePools.releaseDevices", - "azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations.begin_release_devices": "Microsoft.AzureStackHCI.DevicePools.releaseDevices", "azure.mgmt.azurestackhci.operations.UpdateSummariesOperations.get": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.get", "azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations.get": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.get", "azure.mgmt.azurestackhci.operations.UpdateSummariesOperations.put": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.put", @@ -519,5 +366,6 @@ "azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations.begin_delete": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.delete", "azure.mgmt.azurestackhci.operations.UpdateSummariesOperations.list": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.list", "azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations.list": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.list" - } + }, + "CrossLanguageVersion": "726d2381bf68" } \ No newline at end of file diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_client.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_client.py index 861f2691025a..050f78875a14 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_client.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -21,25 +21,15 @@ from ._utils.serialization import Deserializer, Serializer from .operations import ( ArcSettingsOperations, - ClusterJobsOperations, ClustersOperations, DeploymentSettingsOperations, - DevicePoolsOperations, EdgeDeviceJobsOperations, EdgeDevicesOperations, - EdgeMachineJobsOperations, - EdgeMachinesOperations, ExtensionsOperations, - KubernetesVersionsOperations, OffersOperations, Operations, - OsImagesOperations, - OwnershipVouchersOperations, - PlatformUpdatesOperations, - PublishersOperations, SecuritySettingsOperations, SkusOperations, - UpdateContentsOperations, UpdateRunsOperations, UpdateSummariesOperationGroupOperations, UpdateSummariesOperations, @@ -47,6 +37,11 @@ ValidatedSolutionRecipesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -55,14 +50,6 @@ class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes """Azure Stack HCI service. - :ivar kubernetes_versions: KubernetesVersionsOperations operations - :vartype kubernetes_versions: azure.mgmt.azurestackhci.operations.KubernetesVersionsOperations - :ivar platform_updates: PlatformUpdatesOperations operations - :vartype platform_updates: azure.mgmt.azurestackhci.operations.PlatformUpdatesOperations - :ivar os_images: OsImagesOperations operations - :vartype os_images: azure.mgmt.azurestackhci.operations.OsImagesOperations - :ivar update_contents: UpdateContentsOperations operations - :vartype update_contents: azure.mgmt.azurestackhci.operations.UpdateContentsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.azurestackhci.operations.Operations :ivar arc_settings: ArcSettingsOperations operations @@ -79,8 +66,6 @@ class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes :vartype edge_devices: azure.mgmt.azurestackhci.operations.EdgeDevicesOperations :ivar extensions: ExtensionsOperations operations :vartype extensions: azure.mgmt.azurestackhci.operations.ExtensionsOperations - :ivar publishers: PublishersOperations operations - :vartype publishers: azure.mgmt.azurestackhci.operations.PublishersOperations :ivar security_settings: SecuritySettingsOperations operations :vartype security_settings: azure.mgmt.azurestackhci.operations.SecuritySettingsOperations :ivar skus: SkusOperations operations @@ -95,16 +80,6 @@ class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes :ivar validated_solution_recipes: ValidatedSolutionRecipesOperations operations :vartype validated_solution_recipes: azure.mgmt.azurestackhci.operations.ValidatedSolutionRecipesOperations - :ivar edge_machines: EdgeMachinesOperations operations - :vartype edge_machines: azure.mgmt.azurestackhci.operations.EdgeMachinesOperations - :ivar edge_machine_jobs: EdgeMachineJobsOperations operations - :vartype edge_machine_jobs: azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations - :ivar ownership_vouchers: OwnershipVouchersOperations operations - :vartype ownership_vouchers: azure.mgmt.azurestackhci.operations.OwnershipVouchersOperations - :ivar cluster_jobs: ClusterJobsOperations operations - :vartype cluster_jobs: azure.mgmt.azurestackhci.operations.ClusterJobsOperations - :ivar device_pools: DevicePoolsOperations operations - :vartype device_pools: azure.mgmt.azurestackhci.operations.DevicePoolsOperations :ivar update_summaries: UpdateSummariesOperations operations :vartype update_summaries: azure.mgmt.azurestackhci.operations.UpdateSummariesOperations :param credential: Credential used to authenticate requests to the service. Required. @@ -116,9 +91,9 @@ class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-04-01-preview". Default value is "2026-04-01-preview". Note that overriding this default - value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-04-30" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -171,14 +146,6 @@ def __init__( self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.kubernetes_versions = KubernetesVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.platform_updates = PlatformUpdatesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.os_images = OsImagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.update_contents = UpdateContentsOperations(self._client, self._config, self._serialize, self._deserialize) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.arc_settings = ArcSettingsOperations(self._client, self._config, self._serialize, self._deserialize) self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize) @@ -189,7 +156,6 @@ def __init__( self.edge_device_jobs = EdgeDeviceJobsOperations(self._client, self._config, self._serialize, self._deserialize) self.edge_devices = EdgeDevicesOperations(self._client, self._config, self._serialize, self._deserialize) self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) self.security_settings = SecuritySettingsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -202,15 +168,6 @@ def __init__( self.validated_solution_recipes = ValidatedSolutionRecipesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.edge_machines = EdgeMachinesOperations(self._client, self._config, self._serialize, self._deserialize) - self.edge_machine_jobs = EdgeMachineJobsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.ownership_vouchers = OwnershipVouchersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.cluster_jobs = ClusterJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.device_pools = DevicePoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.update_summaries = UpdateSummariesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py index db63d4a9147f..1434e5c76bb8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py @@ -33,9 +33,9 @@ class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-att :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-04-01-preview". Default value is "2026-04-01-preview". Note that overriding this default - value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-04-30" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -47,7 +47,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-04-01-preview") + api_version: str = kwargs.pop("api_version", "2026-04-30") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/model_base.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/model_base.py index db24930fdca9..4102784f9a85 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/model_base.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -595,11 +600,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } + dict_to_pass: dict[str, typing.Any] = {} if args: if isinstance(args[0], ET.Element): dict_to_pass.update(self._init_from_xml(args[0])) @@ -619,6 +620,14 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: @@ -1113,7 +1122,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/serialization.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/serialization.py index 81ec1de5922b..954bf7ebffa7 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/serialization.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py index 8a0b0d5ea65b..ed29b211f9a1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.1.0b1" +VERSION = "8.1.0" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_client.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_client.py index fb5c184028b1..52e035deed7b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_client.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -21,25 +21,15 @@ from ._configuration import AzureStackHCIClientConfiguration from .operations import ( ArcSettingsOperations, - ClusterJobsOperations, ClustersOperations, DeploymentSettingsOperations, - DevicePoolsOperations, EdgeDeviceJobsOperations, EdgeDevicesOperations, - EdgeMachineJobsOperations, - EdgeMachinesOperations, ExtensionsOperations, - KubernetesVersionsOperations, OffersOperations, Operations, - OsImagesOperations, - OwnershipVouchersOperations, - PlatformUpdatesOperations, - PublishersOperations, SecuritySettingsOperations, SkusOperations, - UpdateContentsOperations, UpdateRunsOperations, UpdateSummariesOperationGroupOperations, UpdateSummariesOperations, @@ -47,6 +37,11 @@ ValidatedSolutionRecipesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -55,15 +50,6 @@ class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes """Azure Stack HCI service. - :ivar kubernetes_versions: KubernetesVersionsOperations operations - :vartype kubernetes_versions: - azure.mgmt.azurestackhci.aio.operations.KubernetesVersionsOperations - :ivar platform_updates: PlatformUpdatesOperations operations - :vartype platform_updates: azure.mgmt.azurestackhci.aio.operations.PlatformUpdatesOperations - :ivar os_images: OsImagesOperations operations - :vartype os_images: azure.mgmt.azurestackhci.aio.operations.OsImagesOperations - :ivar update_contents: UpdateContentsOperations operations - :vartype update_contents: azure.mgmt.azurestackhci.aio.operations.UpdateContentsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.azurestackhci.aio.operations.Operations :ivar arc_settings: ArcSettingsOperations operations @@ -81,8 +67,6 @@ class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes :vartype edge_devices: azure.mgmt.azurestackhci.aio.operations.EdgeDevicesOperations :ivar extensions: ExtensionsOperations operations :vartype extensions: azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations - :ivar publishers: PublishersOperations operations - :vartype publishers: azure.mgmt.azurestackhci.aio.operations.PublishersOperations :ivar security_settings: SecuritySettingsOperations operations :vartype security_settings: azure.mgmt.azurestackhci.aio.operations.SecuritySettingsOperations :ivar skus: SkusOperations operations @@ -97,17 +81,6 @@ class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes :ivar validated_solution_recipes: ValidatedSolutionRecipesOperations operations :vartype validated_solution_recipes: azure.mgmt.azurestackhci.aio.operations.ValidatedSolutionRecipesOperations - :ivar edge_machines: EdgeMachinesOperations operations - :vartype edge_machines: azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations - :ivar edge_machine_jobs: EdgeMachineJobsOperations operations - :vartype edge_machine_jobs: azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations - :ivar ownership_vouchers: OwnershipVouchersOperations operations - :vartype ownership_vouchers: - azure.mgmt.azurestackhci.aio.operations.OwnershipVouchersOperations - :ivar cluster_jobs: ClusterJobsOperations operations - :vartype cluster_jobs: azure.mgmt.azurestackhci.aio.operations.ClusterJobsOperations - :ivar device_pools: DevicePoolsOperations operations - :vartype device_pools: azure.mgmt.azurestackhci.aio.operations.DevicePoolsOperations :ivar update_summaries: UpdateSummariesOperations operations :vartype update_summaries: azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations :param credential: Credential used to authenticate requests to the service. Required. @@ -119,9 +92,9 @@ class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-04-01-preview". Default value is "2026-04-01-preview". Note that overriding this default - value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-04-30" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -176,14 +149,6 @@ def __init__( self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.kubernetes_versions = KubernetesVersionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.platform_updates = PlatformUpdatesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.os_images = OsImagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.update_contents = UpdateContentsOperations(self._client, self._config, self._serialize, self._deserialize) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.arc_settings = ArcSettingsOperations(self._client, self._config, self._serialize, self._deserialize) self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize) @@ -194,7 +159,6 @@ def __init__( self.edge_device_jobs = EdgeDeviceJobsOperations(self._client, self._config, self._serialize, self._deserialize) self.edge_devices = EdgeDevicesOperations(self._client, self._config, self._serialize, self._deserialize) self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) self.security_settings = SecuritySettingsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -207,15 +171,6 @@ def __init__( self.validated_solution_recipes = ValidatedSolutionRecipesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.edge_machines = EdgeMachinesOperations(self._client, self._config, self._serialize, self._deserialize) - self.edge_machine_jobs = EdgeMachineJobsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.ownership_vouchers = OwnershipVouchersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.cluster_jobs = ClusterJobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.device_pools = DevicePoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.update_summaries = UpdateSummariesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py index 5919b573bdcd..c53aa1a6e5a0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py @@ -33,9 +33,9 @@ class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-att :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-04-01-preview". Default value is "2026-04-01-preview". Note that overriding this default - value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-04-30" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -47,7 +47,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-04-01-preview") + api_version: str = kwargs.pop("api_version", "2026-04-30") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py index ada4c640dec6..08721ac8e7e8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py @@ -12,10 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import KubernetesVersionsOperations # type: ignore -from ._operations import PlatformUpdatesOperations # type: ignore -from ._operations import OsImagesOperations # type: ignore -from ._operations import UpdateContentsOperations # type: ignore from ._operations import Operations # type: ignore from ._operations import ArcSettingsOperations # type: ignore from ._operations import OffersOperations # type: ignore @@ -24,18 +20,12 @@ from ._operations import EdgeDeviceJobsOperations # type: ignore from ._operations import EdgeDevicesOperations # type: ignore from ._operations import ExtensionsOperations # type: ignore -from ._operations import PublishersOperations # type: ignore from ._operations import SecuritySettingsOperations # type: ignore from ._operations import SkusOperations # type: ignore from ._operations import UpdateRunsOperations # type: ignore from ._operations import UpdatesOperations # type: ignore from ._operations import UpdateSummariesOperationGroupOperations # type: ignore from ._operations import ValidatedSolutionRecipesOperations # type: ignore -from ._operations import EdgeMachinesOperations # type: ignore -from ._operations import EdgeMachineJobsOperations # type: ignore -from ._operations import OwnershipVouchersOperations # type: ignore -from ._operations import ClusterJobsOperations # type: ignore -from ._operations import DevicePoolsOperations # type: ignore from ._operations import UpdateSummariesOperations # type: ignore from ._patch import __all__ as _patch_all @@ -43,10 +33,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "KubernetesVersionsOperations", - "PlatformUpdatesOperations", - "OsImagesOperations", - "UpdateContentsOperations", "Operations", "ArcSettingsOperations", "OffersOperations", @@ -55,18 +41,12 @@ "EdgeDeviceJobsOperations", "EdgeDevicesOperations", "ExtensionsOperations", - "PublishersOperations", "SecuritySettingsOperations", "SkusOperations", "UpdateRunsOperations", "UpdatesOperations", "UpdateSummariesOperationGroupOperations", "ValidatedSolutionRecipesOperations", - "EdgeMachinesOperations", - "EdgeMachineJobsOperations", - "OwnershipVouchersOperations", - "ClusterJobsOperations", - "DevicePoolsOperations", "UpdateSummariesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py index a68a58d06e89..34fc5c5e8833 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py @@ -48,11 +48,6 @@ build_arc_settings_list_by_cluster_request, build_arc_settings_reconcile_request, build_arc_settings_update_request, - build_cluster_jobs_create_or_update_request, - build_cluster_jobs_delete_request, - build_cluster_jobs_get_request, - build_cluster_jobs_list_request, - build_clusters_change_ring_request, build_clusters_configure_remote_support_request, build_clusters_create_identity_request, build_clusters_create_request, @@ -69,14 +64,6 @@ build_deployment_settings_delete_request, build_deployment_settings_get_request, build_deployment_settings_list_by_clusters_request, - build_device_pools_claim_devices_request, - build_device_pools_create_or_update_request, - build_device_pools_delete_request, - build_device_pools_get_request, - build_device_pools_list_by_resource_group_request, - build_device_pools_list_by_subscription_request, - build_device_pools_release_devices_request, - build_device_pools_update_request, build_edge_device_jobs_create_or_update_request, build_edge_device_jobs_delete_request, build_edge_device_jobs_get_request, @@ -86,42 +73,22 @@ build_edge_devices_get_request, build_edge_devices_list_request, build_edge_devices_validate_request, - build_edge_machine_jobs_create_or_update_request, - build_edge_machine_jobs_delete_request, - build_edge_machine_jobs_get_request, - build_edge_machine_jobs_list_request, - build_edge_machines_create_or_update_request, - build_edge_machines_delete_request, - build_edge_machines_get_request, - build_edge_machines_list_by_resource_group_request, - build_edge_machines_list_by_subscription_request, - build_edge_machines_update_request, build_extensions_create_request, build_extensions_delete_request, build_extensions_get_request, build_extensions_list_by_arc_setting_request, build_extensions_update_request, build_extensions_upgrade_request, - build_kubernetes_versions_list_by_subscription_location_resource_request, build_offers_get_request, build_offers_list_by_cluster_request, build_offers_list_by_publisher_request, build_operations_list_request, - build_os_images_get_request, - build_os_images_list_by_subscription_location_resource_request, - build_ownership_vouchers_validate_request, - build_platform_updates_get_request, - build_platform_updates_list_request, - build_publishers_get_request, - build_publishers_list_by_cluster_request, build_security_settings_create_or_update_request, build_security_settings_delete_request, build_security_settings_get_request, build_security_settings_list_by_clusters_request, build_skus_get_request, build_skus_list_by_offer_request, - build_update_contents_get_request, - build_update_contents_list_request, build_update_runs_delete_request, build_update_runs_get_request, build_update_runs_list_request, @@ -149,14 +116,14 @@ List = list -class KubernetesVersionsOperations: +class Operations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`kubernetes_versions` attribute. + :attr:`operations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -167,27 +134,17 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_subscription_location_resource( - self, location: str, **kwargs: Any - ) -> AsyncItemPaged["_models.KubernetesVersion"]: - """List all kubernetes versions. + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: + """List the operations for the provider. - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of KubernetesVersion - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.KubernetesVersion] + :return: An iterator like instance of Operation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.KubernetesVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -200,9 +157,7 @@ def list_by_subscription_location_resource( def prepare_request(next_link=None): if not next_link: - _request = build_kubernetes_versions_list_by_subscription_location_resource_request( - location=location, - subscription_id=self._config.subscription_id, + _request = build_operations_list_request( api_version=self._config.api_version, headers=_headers, params=_params, @@ -225,7 +180,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -239,7 +197,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.KubernetesVersion], + List[_models.Operation], deserialized.get("value", []), ) if cls: @@ -268,14 +226,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class PlatformUpdatesOperations: +class ArcSettingsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`platform_updates` attribute. + :attr:`arc_settings` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -286,22 +244,21 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "location", "platform_update_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def get(self, location: str, platform_update_name: str, **kwargs: Any) -> _models.PlatformUpdate: - """Get a platform update. + async def get( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.ArcSetting: + """Get ArcSetting resource details of HCI Cluster. - :param location: The name of the Azure region. Required. - :type location: str - :param platform_update_name: The name of the PlatformUpdate. Required. - :type platform_update_name: str - :return: PlatformUpdate. The PlatformUpdate is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.PlatformUpdate + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -315,11 +272,12 @@ async def get(self, location: str, platform_update_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PlatformUpdate] = kwargs.pop("cls", None) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - _request = build_platform_updates_get_request( - location=location, - platform_update_name=platform_update_name, + _request = build_arc_settings_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -354,34 +312,135 @@ async def get(self, location: str, platform_update_name: str, **kwargs: Any) -> if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PlatformUpdate, response.json()) + deserialized = _deserialize(_models.ArcSetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.PlatformUpdate"]: - """List all platform updates. + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: _models.ArcSetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of PlatformUpdate - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.PlatformUpdate] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.PlatformUpdate]] = kwargs.pop("cls", None) + @distributed_trace_async + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: Union[_models.ArcSetting, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Is one of the following types: ArcSetting, JSON, IO[bytes] Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting or JSON or IO[bytes] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -390,111 +449,183 @@ def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.Platform } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_platform_updates_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - return _request + content_type = content_type or "application/json" + _content = None + if isinstance(arc_setting, (IOBase, bytes)): + _content = arc_setting + else: + _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.PlatformUpdate], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + _request = build_arc_settings_create_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - async def get_next(next_link=None): - _request = prepare_request(next_link) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) - return AsyncItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized # type: ignore -class OsImagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: _models.ArcSettingsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`os_images` attribute. - """ + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "location", "os_image_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def get(self, location: str, os_image_name: str, **kwargs: Any) -> _models.OsImage: - """Get a os image. + async def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: Union[_models.ArcSettingsPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. - :param location: The name of the Azure region. Required. - :type location: str - :param os_image_name: The name of the OsImage. Required. - :type os_image_name: str - :return: OsImage. The OsImage is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.OsImage + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Is one of the following + types: ArcSettingsPatch, JSON, IO[bytes] Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch or JSON or IO[bytes] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -505,16 +636,27 @@ async def get(self, location: str, os_image_name: str, **kwargs: Any) -> _models } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.OsImage] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - _request = build_os_images_get_request( - location=location, - os_image_name=os_image_name, + content_type = content_type or "application/json" + _content = None + if isinstance(arc_setting, (IOBase, bytes)): + _content = arc_setting + else: + _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_arc_settings_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -547,33 +689,16 @@ async def get(self, location: str, os_image_name: str, **kwargs: Any) -> _models if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.OsImage, response.json()) + deserialized = _deserialize(_models.ArcSetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_subscription_location_resource(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.OsImage"]: - """List all os images. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of OsImage - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.OsImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OsImage]] = kwargs.pop("cls", None) - + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -582,189 +707,141 @@ def list_by_subscription_location_resource(self, location: str, **kwargs: Any) - } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_os_images_list_by_subscription_location_resource_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_arc_settings_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OsImage], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) -class UpdateContentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`update_contents` attribute. - """ + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "location", "update_content_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def get(self, location: str, update_content_name: str, **kwargs: Any) -> _models.UpdateContent: - """Gets content for an update. + async def begin_delete( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete ArcSetting resource details of HCI Cluster. - :param location: The name of the Azure region. Required. - :type location: str - :param update_content_name: The name of the UpdateContent. Required. - :type update_content_name: str - :return: UpdateContent. The UpdateContent is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateContent + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateContent] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - _request = build_update_contents_get_request( - location=location, - update_content_name=update_content_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.UpdateContent, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.UpdateContent"]: - """List all update contents. + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ArcSetting"]: + """Get ArcSetting resources of HCI Cluster. - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of UpdateContent - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.UpdateContent] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ArcSetting + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ArcSetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.UpdateContent]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ArcSetting]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -777,8 +854,9 @@ def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.UpdateCo def prepare_request(next_link=None): if not next_link: - _request = build_update_contents_list_request( - location=location, + _request = build_arc_settings_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -802,7 +880,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -816,7 +897,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.UpdateContent], + List[_models.ArcSetting], deserialized.get("value", []), ) if cls: @@ -844,37 +925,24 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async + async def generate_password( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.PasswordCredential: + """Generate password for arc settings. -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: - """List the operations for the provider. - - :return: An iterator like instance of Operation - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Operation] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: PasswordCredential. The PasswordCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -883,124 +951,12 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - return _request + cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Operation], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ArcSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`arc_settings` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.ArcSetting: - """Get ArcSetting resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - _request = build_arc_settings_get_request( + _request = build_arc_settings_generate_password_request( resource_group_name=resource_group_name, cluster_name=cluster_name, arc_setting_name=arc_setting_name, @@ -1038,135 +994,16 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ArcSetting, response.json()) + deserialized = _deserialize(_models.PasswordCredential, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: _models.ArcSetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: Union[_models.ArcSetting, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Is one of the following types: ArcSetting, JSON, IO[bytes] Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting or JSON or IO[bytes] - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def _create_identity_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1175,27 +1012,17 @@ async def create( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(arc_setting, (IOBase, bytes)): - _content = arc_setting - else: - _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_arc_settings_create_request( + _request = build_arc_settings_create_identity_request( resource_group_name=resource_group_name, cluster_name=cluster_name, arc_setting_name=arc_setting_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -1205,19 +1032,18 @@ async def create( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -1225,28 +1051,26 @@ async def create( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ArcSetting, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: _models.ArcSettingsPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. + @distributed_trace_async + async def begin_create_identity( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ArcIdentityResponse]: + """Create Aad identity for arc settings. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1256,104 +1080,77 @@ async def update( :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting information. Required. :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :return: An instance of AsyncLROPoller that returns ArcIdentityResponse. The + ArcIdentityResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. + cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. + deserialized = _deserialize(_models.ArcIdentityResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - @distributed_trace_async - async def update( + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ArcIdentityResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ArcIdentityResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _reconcile_initial( self, resource_group_name: str, cluster_name: str, arc_setting_name: str, - arc_setting: Union[_models.ArcSettingsPatch, JSON, IO[bytes]], + reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Is one of the following - types: ArcSettingsPatch, JSON, IO[bytes] Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch or JSON or IO[bytes] - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1366,16 +1163,16 @@ async def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(arc_setting, (IOBase, bytes)): - _content = arc_setting + if isinstance(reconcile_arc_settings_request, (IOBase, bytes)): + _content = reconcile_arc_settings_request else: - _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(reconcile_arc_settings_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_arc_settings_update_request( + _request = build_arc_settings_reconcile_request( resource_group_name=resource_group_name, cluster_name=cluster_name, arc_setting_name=arc_setting_name, @@ -1391,67 +1188,6 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ArcSetting, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_arc_settings_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access @@ -1460,7 +1196,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1477,6 +1213,7 @@ async def _delete_initial( response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -1486,11 +1223,18 @@ async def _delete_initial( return deserialized # type: ignore - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete ArcSetting resource details of HCI Cluster. + @overload + async def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: _models.ReconcileArcSettingsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1500,22 +1244,125 @@ async def begin_delete( :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting information. Required. :type arc_setting_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: + ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Is one of the + following types: ReconcileArcSettingsRequest, JSON, IO[bytes] Required. + :type reconcile_arc_settings_request: + ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._reconcile_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, arc_setting_name=arc_setting_name, + reconcile_arc_settings_request=reconcile_arc_settings_request, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1524,9 +1371,19 @@ async def begin_delete( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArcSetting, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -1541,118 +1398,21 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.ArcSetting].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ArcSetting"]: - """Get ArcSetting resources of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of ArcSetting - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ArcSetting]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_arc_settings_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ArcSetting], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + return AsyncLROPoller[_models.ArcSetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace_async - async def generate_password( + async def consent_and_install_default_extensions( self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.PasswordCredential: - """Generate password for arc settings. + ) -> _models.ArcSetting: + """Add consent time for default extensions and initiate extensions installation. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1662,8 +1422,8 @@ async def generate_password( :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting information. Required. :type arc_setting_name: str - :return: PasswordCredential. The PasswordCredential is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1677,9 +1437,9 @@ async def generate_password( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - _request = build_arc_settings_generate_password_request( + _request = build_arc_settings_consent_and_install_default_extensions_request( resource_group_name=resource_group_name, cluster_name=cluster_name, arc_setting_name=arc_setting_name, @@ -1717,14 +1477,14 @@ async def generate_password( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.PasswordCredential, response.json()) + deserialized = _deserialize(_models.ArcSetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_identity_initial( + async def _initialize_disable_process_initial( self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1740,7 +1500,7 @@ async def _create_identity_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_arc_settings_create_identity_request( + _request = build_arc_settings_initialize_disable_process_request( resource_group_name=resource_group_name, cluster_name=cluster_name, arc_setting_name=arc_setting_name, @@ -1790,10 +1550,10 @@ async def _create_identity_initial( return deserialized # type: ignore @distributed_trace_async - async def begin_create_identity( + async def begin_initialize_disable_process( self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ArcIdentityResponse]: - """Create Aad identity for arc settings. + ) -> AsyncLROPoller[None]: + """Initializes ARC Disable process on the cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1803,21 +1563,19 @@ async def begin_create_identity( :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting information. Required. :type arc_setting_name: str - :return: An instance of AsyncLROPoller that returns ArcIdentityResponse. The - ArcIdentityResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_identity_initial( + raw_result = await self._initialize_disable_process_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, arc_setting_name=arc_setting_name, @@ -1829,19 +1587,9 @@ async def begin_create_identity( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.ArcIdentityResponse, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -1856,24 +1604,61 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.ArcIdentityResponse].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ArcIdentityResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _reconcile_initial( + +class OffersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`offers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], + publisher_name: str, + offer_name: str, + *, + expand: Optional[str] = None, **kwargs: Any - ) -> AsyncIterator[bytes]: + ) -> _models.Offer: + """Get Offer resource details within a publisher of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: Offer. The Offer is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Offer + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1882,27 +1667,19 @@ async def _reconcile_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(reconcile_arc_settings_request, (IOBase, bytes)): - _content = reconcile_arc_settings_request - else: - _content = json.dumps(reconcile_arc_settings_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Offer] = kwargs.pop("cls", None) - _request = build_arc_settings_reconcile_request( + _request = build_offers_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, + publisher_name=publisher_name, + offer_name=offer_name, subscription_id=self._config.subscription_id, - content_type=content_type, + expand=expand, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -1912,18 +1689,19 @@ async def _reconcile_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -1931,222 +1709,266 @@ async def _reconcile_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Offer, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def begin_reconcile( + @distributed_trace + def list_by_publisher( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: _models.ReconcileArcSettingsRequest, + publisher_name: str, *, - content_type: str = "application/json", + expand: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.ArcSetting]: - """Reconcile Arc Settings with information related to all nodes. + ) -> AsyncItemPaged["_models.Offer"]: + """List Offers available for a publisher within the HCI Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. - :type reconcile_arc_settings_request: - ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Offer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Offer] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def begin_reconcile( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcSetting]: - """Reconcile Arc Settings with information related to all nodes. + cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. - :type reconcile_arc_settings_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - async def begin_reconcile( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcSetting]: - """Reconcile Arc Settings with information related to all nodes. + def prepare_request(next_link=None): + if not next_link: - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. - :type reconcile_arc_settings_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ + _request = build_offers_list_by_publisher_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - @distributed_trace_async - async def begin_reconcile( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcSetting]: - """Reconcile Arc Settings with information related to all nodes. + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Offer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Offer"]: + """List Offers available across publishers for the HCI Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Is one of the - following types: ReconcileArcSettingsRequest, JSON, IO[bytes] Required. - :type reconcile_arc_settings_request: - ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Offer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Offer] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._reconcile_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - reconcile_arc_settings_request=reconcile_arc_settings_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - deserialized = _deserialize(_models.ArcSetting, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + def prepare_request(next_link=None): + if not next_link: - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + _request = build_offers_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Offer], + deserialized.get("value", []), ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ArcSetting].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return AsyncLROPoller[_models.ArcSetting]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def consent_and_install_default_extensions( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.ArcSetting: - """Add consent time for default extensions and initiate extensions installation. + async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: + """Get HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2160,12 +1982,11 @@ async def consent_and_install_default_extensions( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - _request = build_arc_settings_consent_and_install_default_extensions_request( + _request = build_clusters_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2200,186 +2021,114 @@ async def consent_and_install_default_extensions( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ArcSetting, response.json()) + deserialized = _deserialize(_models.Cluster, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _initialize_disable_process_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_arc_settings_initialize_disable_process_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_initialize_disable_process( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Initializes ARC Disable process on the cluster. + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: _models.Cluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param cluster: Details of the HCI cluster. Required. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._initialize_disable_process_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. -class OffersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`offers` attribute. - """ + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get( + async def create( self, resource_group_name: str, cluster_name: str, - publisher_name: str, - offer_name: str, - *, - expand: Optional[str] = None, + cluster: Union[_models.Cluster, JSON, IO[bytes]], **kwargs: Any - ) -> _models.Offer: - """Get Offer resource details within a publisher of HCI Cluster. + ) -> _models.Cluster: + """Create an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: Offer. The Offer is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Offer + :param cluster: Details of the HCI cluster. Is one of the following types: Cluster, JSON, + IO[bytes] Required. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster or JSON or IO[bytes] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2390,19 +2139,26 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Offer] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - _request = build_offers_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(cluster, (IOBase, bytes)): + _content = cluster + else: + _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_create_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, subscription_id=self._config.subscription_id, - expand=expand, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -2435,4822 +2191,184 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Offer, response.json()) + deserialized = _deserialize(_models.Cluster, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list_by_publisher( + @overload + async def update( self, resource_group_name: str, cluster_name: str, - publisher_name: str, + cluster: _models.ClusterPatch, *, - expand: Optional[str] = None, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged["_models.Offer"]: - """List Offers available for a publisher within the HCI Cluster. + ) -> _models.Cluster: + """Update an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: An iterator like instance of Offer - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Offer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_offers_list_by_publisher_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Offer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, *, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Offer"]: - """List Offers available across publishers for the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: An iterator like instance of Offer - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Offer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_offers_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Offer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ClustersOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`clusters` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: - """Get HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - _request = build_clusters_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Cluster, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: _models.Cluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: Union[_models.Cluster, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Is one of the following types: Cluster, JSON, - IO[bytes] Required. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster or JSON or IO[bytes] - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(cluster, (IOBase, bytes)): - _content = cluster - else: - _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Cluster, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: _models.ClusterPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: Union[_models.ClusterPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Is one of the following types: ClusterPatch, JSON, - IO[bytes] Required. - :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch or JSON or IO[bytes] - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(cluster, (IOBase, bytes)): - _content = cluster - else: - _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Cluster, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_clusters_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Cluster"]: - """List all HCI clusters in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of Cluster - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_clusters_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Cluster], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Cluster"]: - """List all HCI clusters in a subscription. - - :return: An iterator like instance of Cluster - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_clusters_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Cluster], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _update_secrets_locations_initial( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_update_secrets_locations_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update_secrets_locations( - self, - resource_group_name: str, - cluster_name: str, - body: _models.SecretsLocationsChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Update cluster secrets locations. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_secrets_locations( - self, - resource_group_name: str, - cluster_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Update cluster secrets locations. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_secrets_locations( - self, - resource_group_name: str, - cluster_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Update cluster secrets locations. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_secrets_locations( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Update cluster secrets locations. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Is one of the following types: - SecretsLocationsChangeRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_secrets_locations_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _upload_certificate_initial( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(upload_certificate_request, (IOBase, bytes)): - _content = upload_certificate_request - else: - _content = json.dumps(upload_certificate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_upload_certificate_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: _models.UploadCertificateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Is one of the following types: - UploadCertificateRequest, JSON, IO[bytes] Required. - :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._upload_certificate_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - upload_certificate_request=upload_certificate_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _create_identity_initial( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_clusters_create_identity_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_create_identity( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterIdentityResponse]: - """Create cluster identity. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of AsyncLROPoller that returns ClusterIdentityResponse. The - ClusterIdentityResponse is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_identity_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.ClusterIdentityResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ClusterIdentityResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ClusterIdentityResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _extend_software_assurance_benefit_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(software_assurance_change_request, (IOBase, bytes)): - _content = software_assurance_change_request - else: - _content = json.dumps(software_assurance_change_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_extend_software_assurance_benefit_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: _models.SoftwareAssuranceChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Is one of - the following types: SoftwareAssuranceChangeRequest, JSON, IO[bytes] Required. - :type software_assurance_change_request: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._extend_software_assurance_benefit_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - software_assurance_change_request=software_assurance_change_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _change_ring_initial( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: Union[_models.ChangeRingRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(change_ring_request, (IOBase, bytes)): - _content = change_ring_request - else: - _content = json.dumps(change_ring_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_change_ring_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_change_ring( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: _models.ChangeRingRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Changes ring of a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param change_ring_request: Change ring request payload. Required. - :type change_ring_request: ~azure.mgmt.azurestackhci.models.ChangeRingRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_change_ring( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Changes ring of a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param change_ring_request: Change ring request payload. Required. - :type change_ring_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_change_ring( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Changes ring of a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param change_ring_request: Change ring request payload. Required. - :type change_ring_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_change_ring( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: Union[_models.ChangeRingRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Changes ring of a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param change_ring_request: Change ring request payload. Is one of the following types: - ChangeRingRequest, JSON, IO[bytes] Required. - :type change_ring_request: ~azure.mgmt.azurestackhci.models.ChangeRingRequest or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._change_ring_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - change_ring_request=change_ring_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _trigger_log_collection_initial( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(log_collection_request, (IOBase, bytes)): - _content = log_collection_request - else: - _content = json.dumps(log_collection_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_trigger_log_collection_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: _models.LogCollectionRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Is one of the following - types: LogCollectionRequest, JSON, IO[bytes] Required. - :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._trigger_log_collection_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - log_collection_request=log_collection_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _configure_remote_support_initial( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(remote_support_request, (IOBase, bytes)): - _content = remote_support_request - else: - _content = json.dumps(remote_support_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_configure_remote_support_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: _models.RemoteSupportRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Is one of the - following types: RemoteSupportRequest, JSON, IO[bytes] Required. - :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._configure_remote_support_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - remote_support_request=remote_support_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class DeploymentSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`deployment_settings` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> _models.DeploymentSetting: - """Get a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: DeploymentSetting. The DeploymentSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.DeploymentSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - - _request = build_deployment_settings_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeploymentSetting, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], - deployment_settings_name: str = "default", - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_deployment_settings_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: _models.DeploymentSetting, - deployment_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: JSON, - deployment_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: IO[bytes], - deployment_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], - deployment_settings_name: str = "default", - **kwargs: Any - ) -> AsyncLROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Is one of the following types: DeploymentSetting, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting or JSON or IO[bytes] - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - resource=resource, - deployment_settings_name=deployment_settings_name, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DeploymentSetting, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DeploymentSetting].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DeploymentSetting]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_deployment_settings_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - deployment_settings_name=deployment_settings_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DeploymentSetting"]: - """List DeploymentSetting resources by Clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of DeploymentSetting - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DeploymentSetting]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_deployment_settings_list_by_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DeploymentSetting], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class EdgeDeviceJobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`edge_device_jobs` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any - ) -> _models.EdgeDeviceJob: - """Get a EdgeDeviceJob. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: EdgeDeviceJob. The EdgeDeviceJob is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) - - _request = build_edge_device_jobs_get_request( - resource_uri=resource_uri, - jobs_name=jobs_name, - edge_device_name=edge_device_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_uri: str, - jobs_name: str, - resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_edge_device_jobs_create_or_update_request( - resource_uri=resource_uri, - jobs_name=jobs_name, - edge_device_name=edge_device_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_uri: str, - jobs_name: str, - resource: _models.EdgeDeviceJob, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDeviceJob]: - """Create a EdgeDeviceJob. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_uri: str, - jobs_name: str, - resource: JSON, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDeviceJob]: - """Create a EdgeDeviceJob. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_uri: str, - jobs_name: str, - resource: IO[bytes], - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDeviceJob]: - """Create a EdgeDeviceJob. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_uri: str, - jobs_name: str, - resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDeviceJob]: - """Create a EdgeDeviceJob. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param resource: Resource create parameters. Is one of the following types: EdgeDeviceJob, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob or JSON or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_uri=resource_uri, - jobs_name=jobs_name, - resource=resource, - edge_device_name=edge_device_name, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EdgeDeviceJob].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EdgeDeviceJob]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_edge_device_jobs_delete_request( - resource_uri=resource_uri, - jobs_name=jobs_name, - edge_device_name=edge_device_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a EdgeDeviceJob. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_uri=resource_uri, - jobs_name=jobs_name, - edge_device_name=edge_device_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_edge_device( - self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any - ) -> AsyncItemPaged["_models.EdgeDeviceJob"]: - """List EdgeDeviceJob resources by EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An iterator like instance of EdgeDeviceJob - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EdgeDeviceJob]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_edge_device_jobs_list_by_edge_device_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EdgeDeviceJob], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class EdgeDevicesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`edge_devices` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> _models.EdgeDevice: - """Get a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: EdgeDevice. The EdgeDevice is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.EdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) - - _request = build_edge_devices_get_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EdgeDevice, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_uri: str, - resource: Union[_models.EdgeDevice, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_edge_devices_create_or_update_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_uri: str, - resource: _models.EdgeDevice, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_uri: str, - resource: JSON, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_uri: str, - resource: IO[bytes], - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_uri: str, - resource: Union[_models.EdgeDevice, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Is one of the following types: EdgeDevice, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice or JSON or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_uri=resource_uri, - resource=resource, - edge_device_name=edge_device_name, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeDevice, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EdgeDevice].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EdgeDevice]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_edge_devices_delete_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.EdgeDevice"]: - """List EdgeDevice resources by parent. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :return: An iterator like instance of EdgeDevice - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EdgeDevice]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_edge_devices_list_request( - resource_uri=resource_uri, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EdgeDevice], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _validate_initial( - self, - resource_uri: str, - validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(validate_request, (IOBase, bytes)): - _content = validate_request - else: - _content = json.dumps(validate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_edge_devices_validate_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_validate( - self, - resource_uri: str, - validate_request: _models.ValidateRequest, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_validate( - self, - resource_uri: str, - validate_request: JSON, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: JSON - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_validate( - self, - resource_uri: str, - validate_request: IO[bytes], - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_validate( - self, - resource_uri: str, - validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Is one of the following types: - ValidateRequest, JSON, IO[bytes] Required. - :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest or JSON or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_initial( - resource_uri=resource_uri, - validate_request=validate_request, - edge_device_name=edge_device_name, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.ValidateResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ValidateResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ValidateResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class ExtensionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`extensions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> _models.Extension: - """Get particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :return: Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Extension - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - - _request = build_extensions_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Extension, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.Extension, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(extension, (IOBase, bytes)): - _content = extension - else: - _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_extensions_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: _models.Extension, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Create Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: ~azure.mgmt.azurestackhci.models.Extension - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :param cluster: Details of the HCI cluster. Required. + :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def update( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: JSON, + cluster: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Create Extension for HCI cluster. + ) -> _models.Cluster: + """Update an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: JSON + :param cluster: Details of the HCI cluster. Required. + :type cluster: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def update( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: IO[bytes], + cluster: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Create Extension for HCI cluster. + ) -> _models.Cluster: + """Update an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: IO[bytes] + :param cluster: Details of the HCI cluster. Required. + :type cluster: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create( + async def update( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.Extension, JSON, IO[bytes]], + cluster: Union[_models.ClusterPatch, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Create Extension for HCI cluster. + ) -> _models.Cluster: + """Update an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Is one of the following - types: Extension, JSON, IO[bytes] Required. - :type extension: ~azure.mgmt.azurestackhci.models.Extension or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :param cluster: Details of the HCI cluster. Is one of the following types: ClusterPatch, JSON, + IO[bytes] Required. + :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch or JSON or IO[bytes] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension=extension, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Extension, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(cluster, (IOBase, bytes)): + _content = cluster + else: + _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_clusters_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Extension].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Extension]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.Cluster, response.json()) - async def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7259,28 +2377,16 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(extension, (IOBase, bytes)): - _content = extension - else: - _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_extensions_update_request( + _request = build_clusters_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7297,7 +2403,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -7311,169 +2417,40 @@ async def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: _models.ExtensionPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Update Extension for HCI cluster. + return cls(pipeline_response, deserialized, response_headers) # type: ignore - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return deserialized # type: ignore @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Update Extension for HCI cluster. + async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Is one of the following - types: ExtensionPatch, JSON, IO[bytes] Required. - :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension=extension, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7482,12 +2459,9 @@ async def begin_update( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Extension, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -7502,18 +2476,210 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Extension].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Extension]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Cluster"]: + """List all HCI clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Cluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Cluster"]: + """List all HCI clusters in a subscription. + + :return: An iterator like instance of Cluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Cluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _update_secrets_locations_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7523,18 +2689,26 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_extensions_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_secrets_locations_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7551,7 +2725,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -7565,9 +2739,6 @@ async def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -7578,182 +2749,170 @@ async def _delete_initial( return deserialized # type: ignore - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete particular Arc Extension of HCI Cluster. + @overload + async def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: _models.SecretsLocationsChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Update cluster secrets locations. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + @overload + async def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Update cluster secrets locations. - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + @overload + async def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Update cluster secrets locations. - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ - @distributed_trace - def list_by_arc_setting( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Extension"]: - """List all Extensions under ArcSetting resource. + @distributed_trace_async + async def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Update cluster secrets locations. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An iterator like instance of Extension - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Extension] + :param body: The content of the action request. Is one of the following types: + SecretsLocationsChangeRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Extension]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_extensions_list_by_arc_setting_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Extension], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_secrets_locations_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - response = pipeline_response.http_response + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return AsyncItemPaged(get_next, extract_data) + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _upgrade_initial( + async def _upload_certificate_initial( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -7772,16 +2931,14 @@ async def _upgrade_initial( content_type = content_type or "application/json" _content = None - if isinstance(extension_upgrade_parameters, (IOBase, bytes)): - _content = extension_upgrade_parameters + if isinstance(upload_certificate_request, (IOBase, bytes)): + _content = upload_certificate_request else: - _content = json.dumps(extension_upgrade_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(upload_certificate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_extensions_upgrade_request( + _request = build_clusters_upload_certificate_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -7818,6 +2975,7 @@ async def _upgrade_initial( response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -7828,32 +2986,24 @@ async def _upgrade_initial( return deserialized # type: ignore @overload - async def begin_upgrade( + async def begin_upload_certificate( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: _models.ExtensionUpgradeParameters, + upload_certificate_request: _models.UploadCertificateRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. + """Upload certificate. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7863,32 +3013,24 @@ async def begin_upgrade( """ @overload - async def begin_upgrade( + async def begin_upload_certificate( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: JSON, + upload_certificate_request: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. + """Upload certificate. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: JSON + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7898,32 +3040,24 @@ async def begin_upgrade( """ @overload - async def begin_upgrade( + async def begin_upload_certificate( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: IO[bytes], + upload_certificate_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. + """Upload certificate. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: IO[bytes] + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -7933,51 +3067,167 @@ async def begin_upgrade( """ @distributed_trace_async - async def begin_upgrade( + async def begin_upload_certificate( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. + """Upload certificate. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Is one of the following types: ExtensionUpgradeParameters, JSON, IO[bytes] Required. - :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters - or JSON or IO[bytes] + :param upload_certificate_request: Upload certificate request. Is one of the following types: + UploadCertificateRequest, JSON, IO[bytes] Required. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest or + JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._upload_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + upload_certificate_request=upload_certificate_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_identity_initial( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_clusters_create_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create_identity( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ClusterIdentityResponse]: + """Create cluster identity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An instance of AsyncLROPoller that returns ClusterIdentityResponse. The + ClusterIdentityResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._upgrade_initial( + raw_result = await self._create_identity_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension_upgrade_parameters=extension_upgrade_parameters, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7986,9 +3236,19 @@ async def begin_upgrade( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ClusterIdentityResponse, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -8003,63 +3263,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.ClusterIdentityResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class PublishersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`publishers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "publisher_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def get( - self, resource_group_name: str, cluster_name: str, publisher_name: str, **kwargs: Any - ) -> _models.Publisher: - """Get Publisher resource details of HCI Cluster. + return AsyncLROPoller[_models.ClusterIdentityResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :return: Publisher. The Publisher is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Publisher - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def _extend_software_assurance_benefit_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8068,17 +3288,26 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(software_assurance_change_request, (IOBase, bytes)): + _content = software_assurance_change_request + else: + _content = json.dumps(software_assurance_change_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_publishers_get_request( + _request = build_clusters_extend_software_assurance_benefit_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - publisher_name=publisher_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -8088,19 +3317,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -8108,221 +3336,184 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Publisher, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Publisher"]: - """List Publishers available for the HCI Cluster. + @overload + async def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: _models.SoftwareAssuranceChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :return: An iterator like instance of Publisher - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Publisher] + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Publisher]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_publishers_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Publisher], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + @overload + async def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. -class SecuritySettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`security_settings` attribute. - """ + @overload + async def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any - ) -> _models.SecuritySetting: - """Get a SecuritySetting. + async def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: SecuritySetting. The SecuritySetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.SecuritySetting + :param software_assurance_change_request: Software Assurance Change Request Payload. Is one of + the following types: SoftwareAssuranceChangeRequest, JSON, IO[bytes] Required. + :type software_assurance_change_request: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._extend_software_assurance_benefit_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + software_assurance_change_request=software_assurance_change_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_security_settings_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.SecuritySetting, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _create_or_update_initial( + async def _trigger_log_collection_initial( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.SecuritySetting, JSON, IO[bytes]], - security_settings_name: str = "default", + log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -8341,16 +3532,15 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(log_collection_request, (IOBase, bytes)): + _content = log_collection_request else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(log_collection_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_security_settings_create_or_update_request( + _request = build_clusters_trigger_log_collection_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -8370,7 +3560,7 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -8383,10 +3573,8 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -8397,138 +3585,126 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_trigger_log_collection( self, resource_group_name: str, cluster_name: str, - resource: _models.SecuritySetting, - security_settings_name: str = "default", + log_collection_request: _models.LogCollectionRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SecuritySetting]: - """Create a security setting. + ) -> AsyncLROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_trigger_log_collection( self, resource_group_name: str, cluster_name: str, - resource: JSON, - security_settings_name: str = "default", + log_collection_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SecuritySetting]: - """Create a security setting. + ) -> AsyncLROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_trigger_log_collection( self, resource_group_name: str, cluster_name: str, - resource: IO[bytes], - security_settings_name: str = "default", + log_collection_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SecuritySetting]: - """Create a security setting. + ) -> AsyncLROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_or_update( + async def begin_trigger_log_collection( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.SecuritySetting, JSON, IO[bytes]], - security_settings_name: str = "default", + log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.SecuritySetting]: - """Create a security setting. + ) -> AsyncLROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Is one of the following types: SecuritySetting, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting or JSON or IO[bytes] - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :param log_collection_request: Trigger Log Collection Request Payload. Is one of the following + types: LogCollectionRequest, JSON, IO[bytes] Required. + :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._trigger_log_collection_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - resource=resource, - security_settings_name=security_settings_name, + log_collection_request=log_collection_request, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -8540,7 +3716,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.SecuritySetting, response.json()) + deserialized = _deserialize(_models.Cluster, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -8558,18 +3734,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.SecuritySetting].from_continuation_token( + return AsyncLROPoller[_models.Cluster].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.SecuritySetting]( + return AsyncLROPoller[_models.Cluster]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any + async def _configure_remote_support_initial( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8579,17 +3759,26 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_security_settings_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(remote_support_request, (IOBase, bytes)): + _content = remote_support_request + else: + _content = json.dumps(remote_support_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_configure_remote_support_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -8606,7 +3795,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -8630,177 +3819,175 @@ async def _delete_initial( return deserialized # type: ignore - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a SecuritySetting. + @overload + async def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: _models.RemoteSupportRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - security_settings_name=security_settings_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + @overload + async def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + @overload + async def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ - @distributed_trace - def list_by_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SecuritySetting"]: - """List SecuritySetting resources by Clusters. + @distributed_trace_async + async def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :return: An iterator like instance of SecuritySetting - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.SecuritySetting] + :param remote_support_request: Configure Remote Support Request Payload. Is one of the + following types: RemoteSupportRequest, JSON, IO[bytes] Required. + :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SecuritySetting]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_security_settings_list_by_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SecuritySetting], - deserialized.get("value", []), + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._configure_remote_support_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + remote_support_request=remote_support_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def get_long_running_output(pipeline_response): response = pipeline_response.http_response + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return AsyncItemPaged(get_next, extract_data) + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) -class SkusOperations: +class DeploymentSettingsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`skus` attribute. + :attr:`deployment_settings` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -8812,34 +3999,19 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - sku_name: str, - *, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.Sku: - """Get SKU resource details within a offer of HCI Cluster. + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any + ) -> _models.DeploymentSetting: + """Get a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :param sku_name: The name of the SKU available within HCI cluster. Required. - :type sku_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: Sku. The Sku is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Sku + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str + :return: DeploymentSetting. The DeploymentSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.DeploymentSetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8853,16 +4025,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Sku] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - _request = build_skus_get_request( + _request = build_deployment_settings_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - sku_name=sku_name, subscription_id=self._config.subscription_id, - expand=expand, + deployment_settings_name=deployment_settings_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8896,166 +4065,21 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Sku, response.json()) + deserialized = _deserialize(_models.DeploymentSetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list_by_offer( + async def _create_or_update_initial( self, resource_group_name: str, cluster_name: str, - publisher_name: str, - offer_name: str, - *, - expand: Optional[str] = None, + resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], + deployment_settings_name: str = "default", **kwargs: Any - ) -> AsyncItemPaged["_models.Sku"]: - """List Skus available for a offer within the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: An iterator like instance of Sku - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Sku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Sku]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_skus_list_by_offer_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Sku], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class UpdateRunsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`update_runs` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any - ) -> _models.UpdateRun: - """Get the Update run for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -9064,18 +4088,27 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_update_runs_get_request( + _request = build_deployment_settings_create_or_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, subscription_id=self._config.subscription_id, + deployment_settings_name=deployment_settings_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -9085,19 +4118,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -9105,214 +4137,194 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.UpdateRun, response.json()) + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - async def put( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: _models.UpdateRun, + resource: _models.DeploymentSetting, + deployment_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. + ) -> AsyncLROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def put( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: JSON, + resource: JSON, + deployment_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. + ) -> AsyncLROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: JSON + :param resource: Resource create parameters. Required. + :type resource: JSON + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def put( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: IO[bytes], + resource: IO[bytes], + deployment_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. + ) -> AsyncLROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: IO[bytes] + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def put( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: Union[_models.UpdateRun, JSON, IO[bytes]], + resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], + deployment_settings_name: str = "default", **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. + ) -> AsyncLROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Is one of the following - types: UpdateRun, JSON, IO[bytes] Required. - :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or JSON or IO[bytes] - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :param resource: Resource create parameters. Is one of the following types: DeploymentSetting, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting or JSON or IO[bytes] + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str + :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + resource=resource, + deployment_settings_name=deployment_settings_name, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(update_runs_properties, (IOBase, bytes)): - _content = update_runs_properties - else: - _content = json.dumps(update_runs_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DeploymentSetting, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_update_runs_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.UpdateRun, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DeploymentSetting].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DeploymentSetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9327,12 +4339,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_update_runs_delete_request( + _request = build_deployment_settings_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, subscription_id=self._config.subscription_id, + deployment_settings_name=deployment_settings_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9350,7 +4361,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9364,9 +4375,7 @@ async def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -9378,19 +4387,17 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete specified Update Run. + """Delete a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -9406,8 +4413,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, + deployment_settings_name=deployment_settings_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9442,26 +4448,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.UpdateRun"]: - """List all Update runs for a specified update. + def list_by_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DeploymentSetting"]: + """List DeploymentSetting resources by Clusters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An iterator like instance of UpdateRun - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.UpdateRun] + :return: An iterator like instance of DeploymentSetting + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.UpdateRun]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DeploymentSetting]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9474,10 +4479,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_update_runs_list_request( + _request = build_deployment_settings_list_by_clusters_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - update_name=update_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9501,7 +4505,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9515,7 +4522,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.UpdateRun], + List[_models.DeploymentSetting], deserialized.get("value", []), ) if cls: @@ -9544,14 +4551,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class UpdatesOperations: +class EdgeDeviceJobsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`updates` attribute. + :attr:`edge_device_jobs` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -9562,18 +4569,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: - """Get specified Update. + async def get( + self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any + ) -> _models.EdgeDeviceJob: + """Get a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: EdgeDeviceJob. The EdgeDeviceJob is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9587,13 +4596,12 @@ async def get(self, resource_group_name: str, cluster_name: str, update_name: st _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Update] = kwargs.pop("cls", None) + cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) - _request = build_updates_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, + _request = build_edge_device_jobs_get_request( + resource_uri=resource_uri, + jobs_name=jobs_name, + edge_device_name=edge_device_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9627,198 +4635,265 @@ async def get(self, resource_group_name: str, cluster_name: str, update_name: st if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Update, response.json()) + deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + async def _create_or_update_initial( + self, + resource_uri: str, + jobs_name: str, + resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_device_jobs_create_or_update_request( + resource_uri=resource_uri, + jobs_name=jobs_name, + edge_device_name=edge_device_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - async def put( + async def begin_create_or_update( self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: _models.Update, + resource_uri: str, + jobs_name: str, + resource: _models.EdgeDeviceJob, + edge_device_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Update: - """Put specified Update. + ) -> AsyncLROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: ~azure.mgmt.azurestackhci.models.Update + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def put( + async def begin_create_or_update( self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: JSON, + resource_uri: str, + jobs_name: str, + resource: JSON, + edge_device_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Update: - """Put specified Update. + ) -> AsyncLROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: JSON + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def put( + async def begin_create_or_update( self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: IO[bytes], + resource_uri: str, + jobs_name: str, + resource: IO[bytes], + edge_device_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Update: - """Put specified Update. + ) -> AsyncLROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: IO[bytes] + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def put( + async def begin_create_or_update( self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: Union[_models.Update, JSON, IO[bytes]], + resource_uri: str, + jobs_name: str, + resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], + edge_device_name: str = "default", **kwargs: Any - ) -> _models.Update: - """Put specified Update. + ) -> AsyncLROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Is one of the following types: - Update, JSON, IO[bytes] Required. - :type update_properties: ~azure.mgmt.azurestackhci.models.Update or JSON or IO[bytes] - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeDeviceJob, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob or JSON or IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Update] = kwargs.pop("cls", None) + cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_uri=resource_uri, + jobs_name=jobs_name, + resource=resource, + edge_device_name=edge_device_name, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(update_properties, (IOBase, bytes)): - _content = update_properties - else: - _content = json.dumps(update_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_updates_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.Update, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EdgeDeviceJob].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EdgeDeviceJob]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9833,11 +4908,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_updates_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, + _request = build_edge_device_jobs_delete_request( + resource_uri=resource_uri, + jobs_name=jobs_name, + edge_device_name=edge_device_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9855,7 +4929,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9869,9 +4943,7 @@ async def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -9883,17 +4955,17 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete specified Update. + """Delete a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -9907,9 +4979,9 @@ async def begin_delete( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, + resource_uri=resource_uri, + jobs_name=jobs_name, + edge_device_name=edge_device_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9944,22 +5016,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Update"]: - """List all Updates. + def list_by_edge_device( + self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any + ) -> AsyncItemPaged["_models.EdgeDeviceJob"]: + """List EdgeDeviceJob resources by EdgeDevice. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of Update - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Update] + :type resource_uri: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: An iterator like instance of EdgeDeviceJob + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Update]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.EdgeDeviceJob]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9972,10 +5046,9 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - _request = build_updates_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, + _request = build_edge_device_jobs_list_by_edge_device_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9998,7 +5071,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10012,7 +5088,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Update], + List[_models.EdgeDeviceJob], deserialized.get("value", []), ) if cls: @@ -10040,9 +5116,37 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - async def _post_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + +class EdgeDevicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`edge_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> _models.EdgeDevice: + """Get a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: EdgeDevice. The EdgeDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -10054,13 +5158,11 @@ async def _post_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) - _request = build_updates_post_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, + _request = build_edge_devices_get_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -10071,18 +5173,19 @@ async def _post_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -10090,98 +5193,22 @@ async def _post_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EdgeDevice, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def begin_post( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Apply Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._post_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "update_name", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _prepare_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + async def _create_or_update_initial( + self, + resource_uri: str, + resource: Union[_models.EdgeDevice, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10191,17 +5218,25 @@ async def _prepare_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_updates_prepare_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_devices_create_or_update_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -10218,7 +5253,7 @@ async def _prepare_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -10231,8 +5266,10 @@ async def _prepare_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -10242,48 +5279,127 @@ async def _prepare_initial( return deserialized # type: ignore + @overload + async def begin_create_or_update( + self, + resource_uri: str, + resource: _models.EdgeDevice, + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + resource: JSON, + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + resource: IO[bytes], + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "update_name", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_prepare( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Prepare Update. + async def begin_create_or_update( + self, + resource_uri: str, + resource: Union[_models.EdgeDevice, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :type resource_uri: str + :param resource: Resource create parameters. Is one of the following types: EdgeDevice, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice or JSON or IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._prepare_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, + raw_result = await self._create_or_update_initial( + resource_uri=resource_uri, + resource=resource, + edge_device_name=edge_device_name, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10292,9 +5408,12 @@ async def begin_prepare( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeDevice, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10309,51 +5428,18 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.EdgeDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class UpdateSummariesOperationGroupOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`update_summaries_operation_group` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return AsyncLROPoller[_models.EdgeDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "content_type", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _check_updates_initial( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CheckUpdatesRequest, JSON, IO[bytes]], - **kwargs: Any + async def _delete_initial( + self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10363,26 +5449,15 @@ async def _check_updates_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_update_summaries_operation_group_check_updates_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, + _request = build_edge_devices_delete_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -10423,178 +5498,167 @@ async def _check_updates_initial( return deserialized # type: ignore - @overload - async def begin_check_updates( - self, - resource_group_name: str, - cluster_name: str, - body: _models.CheckUpdatesRequest, - *, - content_type: str = "application/json", - **kwargs: Any + @distributed_trace_async + async def begin_delete( + self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any ) -> AsyncLROPoller[None]: - """Check for updates. + """Delete a EdgeDevice. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.azurestackhci.models.CheckUpdatesRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str + :type resource_uri: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def begin_check_updates( - self, - resource_group_name: str, - cluster_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Check for updates. + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - @overload - async def begin_check_updates( - self, - resource_group_name: str, - cluster_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Check for updates. + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - :param resource_group_name: The name of the resource group. The name is case insensitive. + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.EdgeDevice"]: + """List EdgeDevice resources by parent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :type resource_uri: str + :return: An iterator like instance of EdgeDevice + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "content_type", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_check_updates( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CheckUpdatesRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Check for updates. + cls: ClsType[List[_models.EdgeDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_devices_list_request( + resource_uri=resource_uri, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Is one of the following types: - CheckUpdatesRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.azurestackhci.models.CheckUpdatesRequest or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + return _request - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._check_updates_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.EdgeDevice], + deserialized.get("value", []), ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) # type: ignore + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + async def get_next(next_link=None): + _request = prepare_request(next_link) - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + response = pipeline_response.http_response - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _check_health_initial( - self, resource_group_name: str, cluster_name: str, **kwargs: Any + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _validate_initial( + self, + resource_uri: str, + validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10604,16 +5668,25 @@ async def _check_health_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_update_summaries_operation_group_check_health_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _content = None + if isinstance(validate_request, (IOBase, bytes)): + _content = validate_request + else: + _content = json.dumps(validate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_devices_validate_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -10630,7 +5703,7 @@ async def _check_health_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -10654,39 +5727,127 @@ async def _check_health_initial( return deserialized # type: ignore + @overload + async def begin_validate( + self, + resource_uri: str, + validate_request: _models.ValidateRequest, + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param validate_request: The content of the action request. Required. + :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate( + self, + resource_uri: str, + validate_request: JSON, + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param validate_request: The content of the action request. Required. + :type validate_request: JSON + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate( + self, + resource_uri: str, + validate_request: IO[bytes], + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param validate_request: The content of the action request. Required. + :type validate_request: IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_check_health( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Check health of UpdateSummaries. + async def begin_validate( + self, + resource_uri: str, + validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateResponse]: + """A long-running resource action. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :type resource_uri: str + :param validate_request: The content of the action request. Is one of the following types: + ValidateRequest, JSON, IO[bytes] Required. + :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest or JSON or IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._check_health_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, + raw_result = await self._validate_initial( + resource_uri=resource_uri, + validate_request=validate_request, + edge_device_name=edge_device_name, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10695,9 +5856,12 @@ async def begin_check_health( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ValidateResponse, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10712,208 +5876,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.ValidateResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ValidatedSolutionRecipesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`validated_solution_recipes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, location: str, validated_solution_recipe_name: str, **kwargs: Any - ) -> _models.ValidatedSolutionRecipe: - """Get a validated solution recipe. - - :param location: The name of the Azure region. Required. - :type location: str - :param validated_solution_recipe_name: The name of the ValidatedSolutionRecipe. Required. - :type validated_solution_recipe_name: str - :return: ValidatedSolutionRecipe. The ValidatedSolutionRecipe is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ValidatedSolutionRecipe] = kwargs.pop("cls", None) - - _request = build_validated_solution_recipes_get_request( - location=location, - validated_solution_recipe_name=validated_solution_recipe_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + return AsyncLROPoller[_models.ValidateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ValidatedSolutionRecipe, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_subscription_location_resource( - self, location: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ValidatedSolutionRecipe"]: - """List all validated solution recipes. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of ValidatedSolutionRecipe - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ValidatedSolutionRecipe]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_validated_solution_recipes_list_by_subscription_location_resource_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ValidatedSolutionRecipe], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - -class EdgeMachinesOperations: +class ExtensionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`edge_machines` attribute. + :attr:`extensions` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -10924,29 +5905,23 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def get(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) -> _models.EdgeMachine: - """Get an edge machine. + async def get( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> _models.Extension: + """Get particular Arc Extension of HCI Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :return: EdgeMachine. The EdgeMachine is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.EdgeMachine + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :return: Extension. The Extension is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Extension :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10960,11 +5935,13 @@ async def get(self, resource_group_name: str, edge_machine_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - _request = build_edge_machines_get_request( + _request = build_extensions_get_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10999,32 +5976,20 @@ async def get(self, resource_group_name: str, edge_machine_name: str, **kwargs: if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.EdgeMachine, response.json()) + deserialized = _deserialize(_models.Extension, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _create_or_update_initial( + async def _create_initial( self, resource_group_name: str, - edge_machine_name: str, - resource: Union[_models.EdgeMachine, JSON, IO[bytes]], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.Extension, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -11043,14 +6008,16 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(extension, (IOBase, bytes)): + _content = extension else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_edge_machines_create_or_update_request( + _request = build_extensions_create_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11098,139 +6065,155 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, - edge_machine_name: str, - resource: _models.EdgeMachine, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: _models.Extension, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachine]: - """Create or update an edge machine. + ) -> AsyncLROPoller[_models.Extension]: + """Create Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachine + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: ~azure.mgmt.azurestackhci.models.Extension :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, - edge_machine_name: str, - resource: JSON, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachine]: - """Create or update an edge machine. + ) -> AsyncLROPoller[_models.Extension]: + """Create Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, - edge_machine_name: str, - resource: IO[bytes], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachine]: - """Create or update an edge machine. + ) -> AsyncLROPoller[_models.Extension]: + """Create Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_create_or_update( + async def begin_create( self, resource_group_name: str, - edge_machine_name: str, - resource: Union[_models.EdgeMachine, JSON, IO[bytes]], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.Extension, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachine]: - """Create or update an edge machine. + ) -> AsyncLROPoller[_models.Extension]: + """Create Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param resource: Resource create parameters. Is one of the following types: EdgeMachine, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachine or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Is one of the following + types: Extension, JSON, IO[bytes] Required. + :type extension: ~azure.mgmt.azurestackhci.models.Extension or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._create_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - resource=resource, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11242,7 +6225,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeMachine, response.json()) + deserialized = _deserialize(_models.Extension, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -11260,35 +6243,23 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.EdgeMachine].from_continuation_token( + return AsyncLROPoller[_models.Extension].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.EdgeMachine]( + return AsyncLROPoller[_models.Extension]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) async def _update_initial( self, resource_group_name: str, - edge_machine_name: str, - properties: Union[_models.EdgeMachinePatch, JSON, IO[bytes]], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -11307,14 +6278,16 @@ async def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(extension, (IOBase, bytes)): + _content = extension else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_edge_machines_update_request( + _request = build_extensions_update_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11349,7 +6322,9 @@ async def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -11363,27 +6338,34 @@ async def _update_initial( async def begin_update( self, resource_group_name: str, - edge_machine_name: str, - properties: _models.EdgeMachinePatch, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: _models.ExtensionPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachine]: - """Update an edge machine. + ) -> AsyncLROPoller[_models.Extension]: + """Update Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.azurestackhci.models.EdgeMachinePatch + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11391,27 +6373,34 @@ async def begin_update( async def begin_update( self, resource_group_name: str, - edge_machine_name: str, - properties: JSON, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachine]: - """Update an edge machine. + ) -> AsyncLROPoller[_models.Extension]: + """Update Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11419,80 +6408,82 @@ async def begin_update( async def begin_update( self, resource_group_name: str, - edge_machine_name: str, - properties: IO[bytes], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachine]: - """Update an edge machine. + ) -> AsyncLROPoller[_models.Extension]: + """Update Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) async def begin_update( self, resource_group_name: str, - edge_machine_name: str, - properties: Union[_models.EdgeMachinePatch, JSON, IO[bytes]], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachine]: - """Update an edge machine. + ) -> AsyncLROPoller[_models.Extension]: + """Update Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param properties: The resource properties to be updated. Is one of the following types: - EdgeMachinePatch, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.azurestackhci.models.EdgeMachinePatch or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Is one of the following + types: ExtensionPatch, JSON, IO[bytes] Required. + :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - properties=properties, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11504,7 +6495,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeMachine, response.json()) + deserialized = _deserialize(_models.Extension, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -11522,25 +6513,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.EdgeMachine].from_continuation_token( + return AsyncLROPoller[_models.Extension].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.EdgeMachine]( + return AsyncLROPoller[_models.Extension]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "edge_machine_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) async def _delete_initial( - self, resource_group_name: str, edge_machine_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11555,9 +6539,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_edge_machines_delete_request( + _request = build_extensions_delete_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11576,7 +6562,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11590,6 +6576,9 @@ async def _delete_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -11601,23 +6590,21 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "edge_machine_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) async def begin_delete( - self, resource_group_name: str, edge_machine_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete an edge machine. + """Delete particular Arc Extension of HCI Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -11632,7 +6619,9 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -11667,25 +6656,27 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.EdgeMachine"]: - """List all edge machines in a resource group. + def list_by_arc_setting( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Extension"]: + """List all Extensions under ArcSetting resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :return: An iterator like instance of EdgeMachine - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachine] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An iterator like instance of Extension + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EdgeMachine]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Extension]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11698,8 +6689,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy def prepare_request(next_link=None): if not next_link: - _request = build_edge_machines_list_by_resource_group_request( + _request = build_extensions_list_by_arc_setting_request( resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11723,7 +6716,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -11737,7 +6733,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.EdgeMachine], + List[_models.Extension], deserialized.get("value", []), ) if cls: @@ -11765,24 +6761,15 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.EdgeMachine"]: - """List all edge machines in a subscription. - - :return: An iterator like instance of EdgeMachine - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EdgeMachine]] = kwargs.pop("cls", None) - + async def _upgrade_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -11791,84 +6778,262 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.EdgeMac } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_edge_machines_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(extension_upgrade_parameters, (IOBase, bytes)): + _content = extension_upgrade_parameters + else: + _content = json.dumps(extension_upgrade_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_extensions_upgrade_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EdgeMachine], - deserialized.get("value", []), + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: _models.ExtensionUpgradeParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. - async def get_next(next_link=None): - _request = prepare_request(next_link) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Is one of the following types: ExtensionUpgradeParameters, JSON, IO[bytes] Required. + :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._upgrade_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension_upgrade_parameters=extension_upgrade_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - response = pipeline_response.http_response + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return AsyncItemPaged(get_next, extract_data) + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class EdgeMachineJobsOperations: +class SecuritySettingsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`edge_machine_jobs` attribute. + :attr:`security_settings` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11879,34 +7044,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) async def get( - self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any - ) -> _models.EdgeMachineJob: - """Get a EdgeMachineJob. + self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any + ) -> _models.SecuritySetting: + """Get a SecuritySetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str - :return: EdgeMachineJob. The EdgeMachineJob is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.EdgeMachineJob + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str + :return: SecuritySetting. The SecuritySetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.SecuritySetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11920,13 +7071,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EdgeMachineJob] = kwargs.pop("cls", None) + cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) - _request = build_edge_machine_jobs_get_request( + _request = build_security_settings_get_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, + security_settings_name=security_settings_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -11960,34 +7111,19 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.EdgeMachineJob, response.json()) + deserialized = _deserialize(_models.SecuritySetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) async def _create_or_update_initial( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, - resource: Union[_models.EdgeMachineJob, JSON, IO[bytes]], + cluster_name: str, + resource: Union[_models.SecuritySetting, JSON, IO[bytes]], + security_settings_name: str = "default", **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -12011,11 +7147,11 @@ async def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_edge_machine_jobs_create_or_update_request( + _request = build_security_settings_create_or_update_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, + security_settings_name=security_settings_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -12065,30 +7201,30 @@ async def _create_or_update_initial( async def begin_create_or_update( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, - resource: _models.EdgeMachineJob, + cluster_name: str, + resource: _models.SecuritySetting, + security_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachineJob]: - """Create a EdgeMachineJob. + ) -> AsyncLROPoller[_models.SecuritySetting]: + """Create a security setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachineJob + :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachineJob. The EdgeMachineJob is + :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -12096,30 +7232,30 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, + cluster_name: str, resource: JSON, + security_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachineJob]: - """Create a EdgeMachineJob. + ) -> AsyncLROPoller[_models.SecuritySetting]: + """Create a security setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param resource: Resource create parameters. Required. :type resource: JSON + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachineJob. The EdgeMachineJob is + :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -12127,88 +7263,73 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, + cluster_name: str, resource: IO[bytes], + security_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachineJob]: - """Create a EdgeMachineJob. + ) -> AsyncLROPoller[_models.SecuritySetting]: + """Create a security setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns EdgeMachineJob. The EdgeMachineJob is + :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) async def begin_create_or_update( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, - resource: Union[_models.EdgeMachineJob, JSON, IO[bytes]], + cluster_name: str, + resource: Union[_models.SecuritySetting, JSON, IO[bytes]], + security_settings_name: str = "default", **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeMachineJob]: - """Create a EdgeMachineJob. + ) -> AsyncLROPoller[_models.SecuritySetting]: + """Create a security setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Is one of the following types: EdgeMachineJob, + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Is one of the following types: SecuritySetting, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachineJob or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns EdgeMachineJob. The EdgeMachineJob is + :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting or JSON or IO[bytes] + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str + :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeMachineJob] = kwargs.pop("cls", None) + cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, resource=resource, + security_settings_name=security_settings_name, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -12220,7 +7341,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeMachineJob, response.json()) + deserialized = _deserialize(_models.SecuritySetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -12238,31 +7359,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.EdgeMachineJob].from_continuation_token( + return AsyncLROPoller[_models.SecuritySetting].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.EdgeMachineJob]( + return AsyncLROPoller[_models.SecuritySetting]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) async def _delete_initial( - self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12277,11 +7385,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_edge_machine_jobs_delete_request( + _request = build_security_settings_delete_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, + security_settings_name=security_settings_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12324,31 +7432,18 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) async def begin_delete( - self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a EdgeMachineJob. + """Delete a SecuritySetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -12363,8 +7458,8 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, + security_settings_name=security_settings_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12399,38 +7494,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def list( - self, resource_group_name: str, edge_machine_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.EdgeMachineJob"]: - """List EdgeMachineJob resources by EdgeMachines. + def list_by_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SecuritySetting"]: + """List SecuritySetting resources by Clusters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :return: An iterator like instance of EdgeMachineJob + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of SecuritySetting :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EdgeMachineJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SecuritySetting]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12443,9 +7525,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_edge_machine_jobs_list_request( + _request = build_security_settings_list_by_clusters_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12469,7 +7551,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -12483,7 +7568,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.EdgeMachineJob], + List[_models.SecuritySetting], deserialized.get("value", []), ) if cls: @@ -12512,14 +7597,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class OwnershipVouchersOperations: +class SkusOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`ownership_vouchers` attribute. + :attr:`skus` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -12529,126 +7614,36 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @overload - async def validate( - self, - resource_group_name: str, - location: str, - validation_request: _models.ValidateOwnershipVouchersRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidateOwnershipVouchersResponse: - """Validates ownership vouchers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param validation_request: Ownership vouchers to be validated. Required. - :type validation_request: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible - with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate( - self, - resource_group_name: str, - location: str, - validation_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidateOwnershipVouchersResponse: - """Validates ownership vouchers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param validation_request: Ownership vouchers to be validated. Required. - :type validation_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible - with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def validate( - self, - resource_group_name: str, - location: str, - validation_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidateOwnershipVouchersResponse: - """Validates ownership vouchers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param validation_request: Ownership vouchers to be validated. Required. - :type validation_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible - with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "location", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def validate( + async def get( self, resource_group_name: str, - location: str, - validation_request: Union[_models.ValidateOwnershipVouchersRequest, JSON, IO[bytes]], + cluster_name: str, + publisher_name: str, + offer_name: str, + sku_name: str, + *, + expand: Optional[str] = None, **kwargs: Any - ) -> _models.ValidateOwnershipVouchersResponse: - """Validates ownership vouchers. + ) -> _models.Sku: + """Get SKU resource details within a offer of HCI Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param validation_request: Ownership vouchers to be validated. Is one of the following types: - ValidateOwnershipVouchersRequest, JSON, IO[bytes] Required. - :type validation_request: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest or - JSON or IO[bytes] - :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible - with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :param sku_name: The name of the SKU available within HCI cluster. Required. + :type sku_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: Sku. The Sku is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Sku :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12659,26 +7654,20 @@ async def validate( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateOwnershipVouchersResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(validation_request, (IOBase, bytes)): - _content = validation_request - else: - _content = json.dumps(validation_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Sku] = kwargs.pop("cls", None) - _request = build_ownership_vouchers_validate_request( + _request = build_skus_get_request( resource_group_name=resource_group_name, - location=location, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + sku_name=sku_name, subscription_id=self._config.subscription_id, - content_type=content_type, + expand=expand, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -12711,22 +7700,141 @@ async def validate( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ValidateOwnershipVouchersResponse, response.json()) + deserialized = _deserialize(_models.Sku, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @distributed_trace + def list_by_offer( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.Sku"]: + """List Skus available for a offer within the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Sku + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Sku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Sku]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_skus_list_by_offer_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Sku], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + -class ClusterJobsOperations: +class UpdateRunsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`cluster_jobs` attribute. + :attr:`update_runs` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -12737,34 +7845,22 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "jobs_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) async def get( - self, resource_group_name: str, cluster_name: str, jobs_name: str, **kwargs: Any - ) -> _models.ClusterJob: - """Get a ClusterJob. + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + ) -> _models.UpdateRun: + """Get the Update run for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :return: ClusterJob. The ClusterJob is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ClusterJob + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12778,12 +7874,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ClusterJob] = kwargs.pop("cls", None) + cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - _request = build_cluster_jobs_get_request( + _request = build_update_runs_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - jobs_name=jobs_name, + update_name=update_name, + update_run_name=update_run_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12818,303 +7915,211 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ClusterJob, response.json()) + deserialized = _deserialize(_models.UpdateRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "jobs_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - jobs_name: str, - resource: Union[_models.ClusterJob, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_cluster_jobs_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - jobs_name=jobs_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @overload - async def begin_create_or_update( + async def put( self, resource_group_name: str, cluster_name: str, - jobs_name: str, - resource: _models.ClusterJob, + update_name: str, + update_run_name: str, + update_runs_properties: _models.UpdateRun, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterJob]: - """Create a ClusterJob. + ) -> _models.UpdateRun: + """Put Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.ClusterJob + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ClusterJob. The ClusterJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterJob] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def put( self, resource_group_name: str, cluster_name: str, - jobs_name: str, - resource: JSON, + update_name: str, + update_run_name: str, + update_runs_properties: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterJob]: - """Create a ClusterJob. + ) -> _models.UpdateRun: + """Put Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ClusterJob. The ClusterJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterJob] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def put( self, resource_group_name: str, cluster_name: str, - jobs_name: str, - resource: IO[bytes], + update_name: str, + update_run_name: str, + update_runs_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterJob]: - """Create a ClusterJob. + ) -> _models.UpdateRun: + """Put Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns ClusterJob. The ClusterJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterJob] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "jobs_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_create_or_update( + async def put( self, resource_group_name: str, cluster_name: str, - jobs_name: str, - resource: Union[_models.ClusterJob, JSON, IO[bytes]], + update_name: str, + update_run_name: str, + update_runs_properties: Union[_models.UpdateRun, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterJob]: - """Create a ClusterJob. + ) -> _models.UpdateRun: + """Put Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Is one of the following types: ClusterJob, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.ClusterJob or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns ClusterJob. The ClusterJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterJob] + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Is one of the following + types: UpdateRun, JSON, IO[bytes] Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or JSON or IO[bytes] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ClusterJob] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - jobs_name=jobs_name, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ClusterJob, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(update_runs_properties, (IOBase, bytes)): + _content = update_runs_properties + else: + _content = json.dumps(update_runs_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_update_runs_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ClusterJob].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ClusterJob]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.UpdateRun, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "jobs_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) async def _delete_initial( - self, resource_group_name: str, cluster_name: str, jobs_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13129,10 +8134,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_cluster_jobs_delete_request( + _request = build_update_runs_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - jobs_name=jobs_name, + update_name=update_name, + update_run_name=update_run_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -13151,7 +8157,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -13165,7 +8171,9 @@ async def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -13176,25 +8184,20 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "jobs_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) async def begin_delete( - self, resource_group_name: str, cluster_name: str, jobs_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a ClusterJob. + """Delete specified Update Run. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -13210,7 +8213,8 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - jobs_name=jobs_name, + update_name=update_name, + update_run_name=update_run_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -13245,29 +8249,26 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncItemPaged["_models.ClusterJob"]: - """List ClusterJob resources by Clusters. + def list( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.UpdateRun"]: + """List all Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :return: An iterator like instance of ClusterJob - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ClusterJob] + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An iterator like instance of UpdateRun + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.UpdateRun] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ClusterJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.UpdateRun]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13280,9 +8281,10 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - _request = build_cluster_jobs_list_request( + _request = build_update_runs_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, + update_name=update_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -13306,7 +8308,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -13320,7 +8325,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ClusterJob], + List[_models.UpdateRun], deserialized.get("value", []), ) if cls: @@ -13349,14 +8354,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class DevicePoolsOperations: +class UpdatesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`device_pools` attribute. + :attr:`updates` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -13367,29 +8372,18 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def get(self, resource_group_name: str, device_pool_name: str, **kwargs: Any) -> _models.DevicePool: - """Get a DevicePool. + async def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: + """Get specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :return: DevicePool. The DevicePool is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.DevicePool + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13403,11 +8397,12 @@ async def get(self, resource_group_name: str, device_pool_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DevicePool] = kwargs.pop("cls", None) + cls: ClsType[_models.Update] = kwargs.pop("cls", None) - _request = build_device_pools_get_request( + _request = build_updates_get_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, + update_name=update_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -13442,287 +8437,128 @@ async def get(self, resource_group_name: str, device_pool_name: str, **kwargs: A if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DevicePool, response.json()) + deserialized = _deserialize(_models.Update, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - device_pool_name: str, - resource: Union[_models.DevicePool, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_device_pools_create_or_update_request( - resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @overload - async def begin_create_or_update( + async def put( self, resource_group_name: str, - device_pool_name: str, - resource: _models.DevicePool, + cluster_name: str, + update_name: str, + update_properties: _models.Update, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.DevicePool]: - """Create a DevicePool. + ) -> _models.Update: + """Put specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.DevicePool + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DevicePool. The DevicePool is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def put( self, resource_group_name: str, - device_pool_name: str, - resource: JSON, + cluster_name: str, + update_name: str, + update_properties: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.DevicePool]: - """Create a DevicePool. + ) -> _models.Update: + """Put specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DevicePool. The DevicePool is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def put( self, resource_group_name: str, - device_pool_name: str, - resource: IO[bytes], + cluster_name: str, + update_name: str, + update_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.DevicePool]: - """Create a DevicePool. + ) -> _models.Update: + """Put specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DevicePool. The DevicePool is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_create_or_update( + async def put( self, resource_group_name: str, - device_pool_name: str, - resource: Union[_models.DevicePool, JSON, IO[bytes]], + cluster_name: str, + update_name: str, + update_properties: Union[_models.Update, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.DevicePool]: - """Create a DevicePool. + ) -> _models.Update: + """Put specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param resource: Resource create parameters. Is one of the following types: DevicePool, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.DevicePool or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns DevicePool. The DevicePool is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Is one of the following types: + Update, JSON, IO[bytes] Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update or JSON or IO[bytes] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DevicePool] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DevicePool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DevicePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DevicePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "device_pool_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _delete_initial( - self, resource_group_name: str, device_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -13731,16 +8567,27 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Update] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(update_properties, (IOBase, bytes)): + _content = update_properties + else: + _content = json.dumps(update_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_device_pools_delete_request( + _request = build_updates_put_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, + update_name=update_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -13750,18 +8597,19 @@ async def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -13769,104 +8617,18 @@ async def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Update, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "device_pool_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_delete( - self, resource_group_name: str, device_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a DevicePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def _update_initial( - self, - resource_group_name: str, - device_pool_name: str, - properties: Union[_models.DevicePoolPatch, JSON, IO[bytes]], - **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13876,26 +8638,17 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_device_pools_update_request( + _request = build_updates_delete_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, + update_name=update_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -13912,7 +8665,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -13926,7 +8679,9 @@ async def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -13936,141 +8691,35 @@ async def _update_initial( return deserialized # type: ignore - @overload - async def begin_update( - self, - resource_group_name: str, - device_pool_name: str, - properties: _models.DevicePoolPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DevicePool]: - """Update a devicePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.azurestackhci.models.DevicePoolPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DevicePool. The DevicePool is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DevicePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - device_pool_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DevicePool]: - """Update a devicePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DevicePool. The DevicePool is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DevicePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - device_pool_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DevicePool]: - """Update a devicePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns DevicePool. The DevicePool is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DevicePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - async def begin_update( - self, - resource_group_name: str, - device_pool_name: str, - properties: Union[_models.DevicePoolPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DevicePool]: - """Update a devicePool. + async def begin_delete( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param properties: The resource properties to be updated. Is one of the following types: - DevicePoolPatch, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.azurestackhci.models.DevicePoolPatch or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns DevicePool. The DevicePool is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DevicePool] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - properties=properties, - content_type=content_type, + cluster_name=cluster_name, + update_name=update_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -14079,12 +8728,9 @@ async def begin_update( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DevicePool, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -14099,36 +8745,31 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.DevicePool].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.DevicePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.DevicePool"]: - """List all device pools in a resource group. + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Update"]: + """List all Updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :return: An iterator like instance of DevicePool - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.DevicePool] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Update + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Update] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DevicePool]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Update]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14141,8 +8782,9 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy def prepare_request(next_link=None): if not next_link: - _request = build_device_pools_list_by_resource_group_request( + _request = build_updates_list_request( resource_group_name=resource_group_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -14166,7 +8808,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -14180,7 +8825,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.DevicePool], + List[_models.Update], deserialized.get("value", []), ) if cls: @@ -14204,104 +8849,304 @@ async def get_next(next_link=None): ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _post_initial( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_updates_post_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_post( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Apply Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._post_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @api_version_validation( + method_added_on="2026-04-01-preview", + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "update_name", + ] + }, + api_versions_list=["2026-04-01-preview", "2026-04-30"], + ) + async def _prepare_initial( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_updates_prepare_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return AsyncItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - @distributed_trace + return deserialized # type: ignore + + @distributed_trace_async @api_version_validation( method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=["2026-04-01-preview"], + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "update_name", + ] + }, + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.DevicePool"]: - """List all device pools in a subscription. + async def begin_prepare( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Prepare Update. - :return: An iterator like instance of DevicePool - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.DevicePool] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DevicePool]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_device_pools_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DevicePool], - deserialized.get("value", []), + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._prepare_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - async def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - response = pipeline_response.http_response + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response +class UpdateSummariesOperationGroupOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - return AsyncItemPaged(get_next, extract_data) + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`update_summaries_operation_group` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @api_version_validation( method_added_on="2026-04-01-preview", @@ -14310,17 +9155,17 @@ async def get_next(next_link=None): "api_version", "subscription_id", "resource_group_name", - "device_pool_name", + "cluster_name", "content_type", ] }, - api_versions_list=["2026-04-01-preview"], + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - async def _claim_devices_initial( + async def _check_updates_initial( self, resource_group_name: str, - device_pool_name: str, - body: Union[_models.ClaimDeviceRequest, JSON, IO[bytes]], + cluster_name: str, + body: Union[_models.CheckUpdatesRequest, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -14344,9 +9189,9 @@ async def _claim_devices_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_device_pools_claim_devices_request( + _request = build_update_summaries_operation_group_check_updates_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -14392,24 +9237,24 @@ async def _claim_devices_initial( return deserialized # type: ignore @overload - async def begin_claim_devices( + async def begin_check_updates( self, resource_group_name: str, - device_pool_name: str, - body: _models.ClaimDeviceRequest, + cluster_name: str, + body: _models.CheckUpdatesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Claiming devices of the pool. + """Check for updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param body: The content of the action request. Required. - :type body: ~azure.mgmt.azurestackhci.models.ClaimDeviceRequest + :type body: ~azure.mgmt.azurestackhci.models.CheckUpdatesRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -14419,22 +9264,22 @@ async def begin_claim_devices( """ @overload - async def begin_claim_devices( + async def begin_check_updates( self, resource_group_name: str, - device_pool_name: str, + cluster_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Claiming devices of the pool. + """Check for updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param body: The content of the action request. Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -14446,22 +9291,22 @@ async def begin_claim_devices( """ @overload - async def begin_claim_devices( + async def begin_check_updates( self, resource_group_name: str, - device_pool_name: str, + cluster_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Claiming devices of the pool. + """Check for updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param body: The content of the action request. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -14480,29 +9325,29 @@ async def begin_claim_devices( "api_version", "subscription_id", "resource_group_name", - "device_pool_name", + "cluster_name", "content_type", ] }, - api_versions_list=["2026-04-01-preview"], + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - async def begin_claim_devices( + async def begin_check_updates( self, resource_group_name: str, - device_pool_name: str, - body: Union[_models.ClaimDeviceRequest, JSON, IO[bytes]], + cluster_name: str, + body: Union[_models.CheckUpdatesRequest, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: - """Claiming devices of the pool. + """Check for updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param body: The content of the action request. Is one of the following types: - ClaimDeviceRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.azurestackhci.models.ClaimDeviceRequest or JSON or IO[bytes] + CheckUpdatesRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.azurestackhci.models.CheckUpdatesRequest or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -14516,9 +9361,9 @@ async def begin_claim_devices( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._claim_devices_initial( + raw_result = await self._check_updates_initial( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -14557,22 +9402,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @api_version_validation( method_added_on="2026-04-01-preview", params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - ] + "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name"] }, - api_versions_list=["2026-04-01-preview"], + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - async def _release_devices_initial( - self, - resource_group_name: str, - device_pool_name: str, - body: Union[_models.ReleaseDeviceRequest, JSON, IO[bytes]], - **kwargs: Any + async def _check_health_initial( + self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14582,26 +9417,16 @@ async def _release_devices_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_device_pools_release_devices_request( + _request = build_update_summaries_operation_group_check_health_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -14623,155 +9448,58 @@ async def _release_devices_initial( await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_release_devices( - self, - resource_group_name: str, - device_pool_name: str, - body: _models.ReleaseDeviceRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Releasing devices of the pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.azurestackhci.models.ReleaseDeviceRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_release_devices( - self, - resource_group_name: str, - device_pool_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Releasing devices of the pool. + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param body: The content of the action request. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - @overload - async def begin_release_devices( - self, - resource_group_name: str, - device_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Releasing devices of the pool. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async @api_version_validation( method_added_on="2026-04-01-preview", params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - ] + "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name"] }, - api_versions_list=["2026-04-01-preview"], + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - async def begin_release_devices( - self, - resource_group_name: str, - device_pool_name: str, - body: Union[_models.ReleaseDeviceRequest, JSON, IO[bytes]], - **kwargs: Any + async def begin_check_health( + self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Releasing devices of the pool. + """Check health of UpdateSummaries. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param body: The content of the action request. Is one of the following types: - ReleaseDeviceRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.azurestackhci.models.ReleaseDeviceRequest or JSON or IO[bytes] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._release_devices_initial( + raw_result = await self._check_health_initial( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - body=body, - content_type=content_type, + cluster_name=cluster_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -14806,6 +9534,194 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore +class ValidatedSolutionRecipesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`validated_solution_recipes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, location: str, validated_solution_recipe_name: str, **kwargs: Any + ) -> _models.ValidatedSolutionRecipe: + """Get a validated solution recipe. + + :param location: The name of the Azure region. Required. + :type location: str + :param validated_solution_recipe_name: The name of the ValidatedSolutionRecipe. Required. + :type validated_solution_recipe_name: str + :return: ValidatedSolutionRecipe. The ValidatedSolutionRecipe is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidatedSolutionRecipe] = kwargs.pop("cls", None) + + _request = build_validated_solution_recipes_get_request( + location=location, + validated_solution_recipe_name=validated_solution_recipe_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ValidatedSolutionRecipe, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription_location_resource( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ValidatedSolutionRecipe"]: + """List all validated solution recipes. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of ValidatedSolutionRecipe + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ValidatedSolutionRecipe]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_validated_solution_recipes_list_by_subscription_location_resource_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ValidatedSolutionRecipe], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + class UpdateSummariesOperations: """ .. warning:: @@ -15240,7 +10156,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py index 90e09638db15..4adcba64b9f3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py @@ -23,26 +23,17 @@ ArcSettingsPatchProperties, AssemblyInfo, AssemblyInfoPayload, - ChangeRingRequest, - ChangeRingRequestProperties, CheckUpdatesRequest, - ClaimDeviceRequest, Cluster, ClusterBillingProperties, ClusterDesiredProperties, ClusterIdentityResponse, ClusterIdentityResponseProperties, - ClusterJob, - ClusterJobProperties, ClusterNode, ClusterPatch, ClusterPatchProperties, ClusterProperties, ClusterReportedProperties, - ClusterSdnProperties, - ConfidentialVmProfile, - ConfidentialVmProperties, - ContentPayload, DefaultExtensionDetails, DeploymentCluster, DeploymentConfiguration, @@ -58,14 +49,7 @@ DeploymentSettingsProperties, DeploymentStep, DeviceConfiguration, - DeviceDetail, - DevicePool, - DevicePoolPatch, - DevicePoolProperties, DnsZones, - DownloadOsJobProperties, - DownloadOsProfile, - DownloadRequest, EceActionStatus, EceDeploymentSecrets, EceReportedProperties, @@ -73,19 +57,6 @@ EdgeDeviceDisks, EdgeDeviceJob, EdgeDeviceProperties, - EdgeMachine, - EdgeMachineCollectLogJobProperties, - EdgeMachineCollectLogJobReportedProperties, - EdgeMachineJob, - EdgeMachineJobProperties, - EdgeMachineNetworkProfile, - EdgeMachineNicDetail, - EdgeMachinePatch, - EdgeMachineProperties, - EdgeMachineRemoteSupportJobProperties, - EdgeMachineRemoteSupportJobReportedProperties, - EdgeMachineRemoteSupportNodeSettings, - EdgeMachineReportedProperties, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, @@ -100,10 +71,7 @@ ExtensionProperties, ExtensionResource, ExtensionUpgradeParameters, - HardwareProfile, HciCollectLogJobProperties, - HciConfigureCvmJobProperties, - HciConfigureSdnIntegrationJobProperties, HciEdgeDevice, HciEdgeDeviceAdapterPropertyOverrides, HciEdgeDeviceArcExtension, @@ -123,14 +91,9 @@ HciReportedProperties, HciStorageProfile, HciValidationFailureDetail, - IgvmStatusDetail, InfrastructureNetwork, - IpAddressRange, IpPools, IsolatedVmAttestationConfiguration, - JobReportedProperties, - KubernetesVersion, - KubernetesVersionProperties, LocalAvailabilityZones, LogCollectionError, LogCollectionJobSession, @@ -140,49 +103,28 @@ LogCollectionRequestProperties, LogCollectionSession, ManagedServiceIdentity, - NetworkAdapter, - NetworkConfiguration, NetworkController, NextBillingModel, NicDetail, Observability, Offer, OfferProperties, - OnboardingConfiguration, Operation, - OperationDetail, OperationDisplay, OptionalServices, - OsImage, - OsImageProperties, - OsProfile, - OsProvisionProfile, - OwnershipVoucherDetails, - OwnershipVoucherValidationDetails, PackageVersionInfo, PasswordCredential, PerNodeExtensionState, PerNodeRemoteSupportSession, PerNodeState, PhysicalNodes, - PlatformPayload, - PlatformUpdate, - PlatformUpdateDetails, - PlatformUpdateProperties, PrecheckResult, PrecheckResultTags, - ProvisionOsJobProperties, - ProvisionOsReportedProperties, - ProvisioningDetails, - ProvisioningRequest, ProxyResource, - Publisher, - PublisherProperties, QosPolicyOverrides, RawCertificateData, ReconcileArcSettingsRequest, ReconcileArcSettingsRequestProperties, - ReleaseDeviceRequest, RemoteSupportJobNodeSettings, RemoteSupportJobReportedProperties, RemoteSupportNodeSettings, @@ -203,14 +145,12 @@ SbePartnerProperties, ScaleUnits, SdnIntegration, - SdnProperties, SecretsLocationDetails, SecretsLocationsChangeRequest, SecurityComplianceStatus, SecurityProperties, SecuritySetting, ServiceConfiguration, - SiteDetails, Sku, SkuMappings, SkuProperties, @@ -219,19 +159,13 @@ SoftwareAssuranceProperties, Step, Storage, - StorageConfiguration, - StorageProfile, StorageS2dConfig, StorageSanConfig, SwitchDetail, SwitchExtension, SystemData, - TargetDeviceConfiguration, - TimeConfiguration, TrackedResource, Update, - UpdateContent, - UpdateContentProperties, UpdatePrerequisite, UpdateProperties, UpdateRun, @@ -241,9 +175,6 @@ UpdateSummariesProperties, UploadCertificateRequest, UserAssignedIdentity, - UserDetails, - ValidateOwnershipVouchersRequest, - ValidateOwnershipVouchersResponse, ValidateRequest, ValidateResponse, ValidatedSolutionRecipe, @@ -255,7 +186,6 @@ ValidatedSolutionRecipeContent, ValidatedSolutionRecipeInfo, ValidatedSolutionRecipeProperties, - WebProxyConfiguration, ) from ._enums import ( # type: ignore @@ -268,8 +198,6 @@ ClusterPattern, ComplianceAssignmentType, ComplianceStatus, - ConfidentialVmIntent, - ConfidentialVmStatus, ConnectivityStatus, CreatedByType, DeploymentMode, @@ -280,44 +208,29 @@ DnsServerConfig, EceSecrets, EdgeDeviceKind, - EdgeMachineConnectivityStatus, - EdgeMachineJobType, - EdgeMachineKind, - EdgeMachineState, ExtensionAggregateState, ExtensionManagedBy, HardwareClass, HciEdgeDeviceJobType, - HciJobType, HealthState, IdentityProvider, - IgvmStatus, ImdsAttestation, - IpAssignmentType, JobStatus, LogCollectionJobType, LogCollectionStatus, ManagedServiceIdentityType, NodeArcState, NodeExtensionState, - OSOperationType, OemActivation, - OnboardingResourceType, OperationType, Origin, OverprovisioningRatio, - OwnerKeyType, - OwnershipVoucherValidationStatus, - ProvisioningOsType, ProvisioningState, RdmaCapability, RebootRequirement, RemoteSupportAccessLevel, RemoteSupportProvisioningState, RemoteSupportType, - SdnIntegrationIntent, - SdnStatus, - SecretType, SecretsType, ServiceName, Severity, @@ -346,26 +259,17 @@ "ArcSettingsPatchProperties", "AssemblyInfo", "AssemblyInfoPayload", - "ChangeRingRequest", - "ChangeRingRequestProperties", "CheckUpdatesRequest", - "ClaimDeviceRequest", "Cluster", "ClusterBillingProperties", "ClusterDesiredProperties", "ClusterIdentityResponse", "ClusterIdentityResponseProperties", - "ClusterJob", - "ClusterJobProperties", "ClusterNode", "ClusterPatch", "ClusterPatchProperties", "ClusterProperties", "ClusterReportedProperties", - "ClusterSdnProperties", - "ConfidentialVmProfile", - "ConfidentialVmProperties", - "ContentPayload", "DefaultExtensionDetails", "DeploymentCluster", "DeploymentConfiguration", @@ -381,14 +285,7 @@ "DeploymentSettingsProperties", "DeploymentStep", "DeviceConfiguration", - "DeviceDetail", - "DevicePool", - "DevicePoolPatch", - "DevicePoolProperties", "DnsZones", - "DownloadOsJobProperties", - "DownloadOsProfile", - "DownloadRequest", "EceActionStatus", "EceDeploymentSecrets", "EceReportedProperties", @@ -396,19 +293,6 @@ "EdgeDeviceDisks", "EdgeDeviceJob", "EdgeDeviceProperties", - "EdgeMachine", - "EdgeMachineCollectLogJobProperties", - "EdgeMachineCollectLogJobReportedProperties", - "EdgeMachineJob", - "EdgeMachineJobProperties", - "EdgeMachineNetworkProfile", - "EdgeMachineNicDetail", - "EdgeMachinePatch", - "EdgeMachineProperties", - "EdgeMachineRemoteSupportJobProperties", - "EdgeMachineRemoteSupportJobReportedProperties", - "EdgeMachineRemoteSupportNodeSettings", - "EdgeMachineReportedProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -423,10 +307,7 @@ "ExtensionProperties", "ExtensionResource", "ExtensionUpgradeParameters", - "HardwareProfile", "HciCollectLogJobProperties", - "HciConfigureCvmJobProperties", - "HciConfigureSdnIntegrationJobProperties", "HciEdgeDevice", "HciEdgeDeviceAdapterPropertyOverrides", "HciEdgeDeviceArcExtension", @@ -446,14 +327,9 @@ "HciReportedProperties", "HciStorageProfile", "HciValidationFailureDetail", - "IgvmStatusDetail", "InfrastructureNetwork", - "IpAddressRange", "IpPools", "IsolatedVmAttestationConfiguration", - "JobReportedProperties", - "KubernetesVersion", - "KubernetesVersionProperties", "LocalAvailabilityZones", "LogCollectionError", "LogCollectionJobSession", @@ -463,49 +339,28 @@ "LogCollectionRequestProperties", "LogCollectionSession", "ManagedServiceIdentity", - "NetworkAdapter", - "NetworkConfiguration", "NetworkController", "NextBillingModel", "NicDetail", "Observability", "Offer", "OfferProperties", - "OnboardingConfiguration", "Operation", - "OperationDetail", "OperationDisplay", "OptionalServices", - "OsImage", - "OsImageProperties", - "OsProfile", - "OsProvisionProfile", - "OwnershipVoucherDetails", - "OwnershipVoucherValidationDetails", "PackageVersionInfo", "PasswordCredential", "PerNodeExtensionState", "PerNodeRemoteSupportSession", "PerNodeState", "PhysicalNodes", - "PlatformPayload", - "PlatformUpdate", - "PlatformUpdateDetails", - "PlatformUpdateProperties", "PrecheckResult", "PrecheckResultTags", - "ProvisionOsJobProperties", - "ProvisionOsReportedProperties", - "ProvisioningDetails", - "ProvisioningRequest", "ProxyResource", - "Publisher", - "PublisherProperties", "QosPolicyOverrides", "RawCertificateData", "ReconcileArcSettingsRequest", "ReconcileArcSettingsRequestProperties", - "ReleaseDeviceRequest", "RemoteSupportJobNodeSettings", "RemoteSupportJobReportedProperties", "RemoteSupportNodeSettings", @@ -526,14 +381,12 @@ "SbePartnerProperties", "ScaleUnits", "SdnIntegration", - "SdnProperties", "SecretsLocationDetails", "SecretsLocationsChangeRequest", "SecurityComplianceStatus", "SecurityProperties", "SecuritySetting", "ServiceConfiguration", - "SiteDetails", "Sku", "SkuMappings", "SkuProperties", @@ -542,19 +395,13 @@ "SoftwareAssuranceProperties", "Step", "Storage", - "StorageConfiguration", - "StorageProfile", "StorageS2dConfig", "StorageSanConfig", "SwitchDetail", "SwitchExtension", "SystemData", - "TargetDeviceConfiguration", - "TimeConfiguration", "TrackedResource", "Update", - "UpdateContent", - "UpdateContentProperties", "UpdatePrerequisite", "UpdateProperties", "UpdateRun", @@ -564,9 +411,6 @@ "UpdateSummariesProperties", "UploadCertificateRequest", "UserAssignedIdentity", - "UserDetails", - "ValidateOwnershipVouchersRequest", - "ValidateOwnershipVouchersResponse", "ValidateRequest", "ValidateResponse", "ValidatedSolutionRecipe", @@ -578,7 +422,6 @@ "ValidatedSolutionRecipeContent", "ValidatedSolutionRecipeInfo", "ValidatedSolutionRecipeProperties", - "WebProxyConfiguration", "AccessLevel", "ActionType", "ArcExtensionState", @@ -588,8 +431,6 @@ "ClusterPattern", "ComplianceAssignmentType", "ComplianceStatus", - "ConfidentialVmIntent", - "ConfidentialVmStatus", "ConnectivityStatus", "CreatedByType", "DeploymentMode", @@ -600,44 +441,29 @@ "DnsServerConfig", "EceSecrets", "EdgeDeviceKind", - "EdgeMachineConnectivityStatus", - "EdgeMachineJobType", - "EdgeMachineKind", - "EdgeMachineState", "ExtensionAggregateState", "ExtensionManagedBy", "HardwareClass", "HciEdgeDeviceJobType", - "HciJobType", "HealthState", "IdentityProvider", - "IgvmStatus", "ImdsAttestation", - "IpAssignmentType", "JobStatus", "LogCollectionJobType", "LogCollectionStatus", "ManagedServiceIdentityType", "NodeArcState", "NodeExtensionState", - "OSOperationType", "OemActivation", - "OnboardingResourceType", "OperationType", "Origin", "OverprovisioningRatio", - "OwnerKeyType", - "OwnershipVoucherValidationStatus", - "ProvisioningOsType", "ProvisioningState", "RdmaCapability", "RebootRequirement", "RemoteSupportAccessLevel", "RemoteSupportProvisioningState", "RemoteSupportType", - "SdnIntegrationIntent", - "SdnStatus", - "SecretType", "SecretsType", "ServiceName", "Severity", diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_enums.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_enums.py index 82efc1b6c13f..c27e06f73940 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_enums.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_enums.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -149,28 +148,6 @@ class ComplianceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The resource compliance status is pending.""" -class ConfidentialVmIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Captures the customer's intent to enable or disable Confidential Virtual Machine (CVM) support - on the cluster, either during initial deployment (Day-0) or at a later stage (Day-N). - """ - - ENABLE = "Enable" - """Indicates that the customer intends to enable CVM support on the cluster.""" - DISABLE = "Disable" - """Indicates that the customer intends to disable CVM support on the cluster.""" - - -class ConfidentialVmStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Captures the current status of Confidential Virtual Machine (CVM) support on the cluster.""" - - ENABLED = "Enabled" - """CVM support is fully enabled on the cluster. All nodes are CVM capable.""" - PARTIALLY_ENABLED = "PartiallyEnabled" - """CVM support is partially enabled. At least one node in the cluster is CVM capable.""" - DISABLED = "Disabled" - """CVM support is disabled. None of the nodes in the cluster are CVM capable.""" - - class ConnectivityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Overall connectivity status for the cluster resource. Indicates whether the cluster is connected to Azure, partially connected, or has not recently communicated. @@ -297,63 +274,6 @@ class EdgeDeviceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Arc-enabled edge device with HCI OS.""" -class EdgeMachineConnectivityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall connectivity status for the machine resource.""" - - NOT_SPECIFIED = "NotSpecified" - """The connectivity status of the machine resource is not specified.""" - DISCONNECTED = "Disconnected" - """The machine resource is disconnected.""" - CONNECTED = "Connected" - """The machine resource is connected.""" - - -class EdgeMachineJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Job Type supported.""" - - COLLECT_LOG = "CollectLog" - """Job to collect logs from the device.""" - REMOTE_SUPPORT = "RemoteSupport" - """Job to provide remote support to the device.""" - PROVISION_OS = "ProvisionOs" - """Job to provision operating system in the device.""" - DOWNLOAD_OS = "DownloadOs" - """Job to download OS packages on to the device.""" - - -class EdgeMachineKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Edge Machine Kind.""" - - STANDARD = "Standard" - """EdgeMachine resource created using Zero-touch provisioning.""" - DEDICATED = "Dedicated" - """EdgeMachine resource created for brownfield HCI customers without zero touch provisioning.""" - - -class EdgeMachineState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """OS State.""" - - CREATED = "Created" - """Created when EdgeMachine resource created.""" - REGISTERING = "Registering" - """EdgeMachine state during device discovery and registration.""" - UNPURPOSED = "Unpurposed" - """EdgeMachine state when machine configured with restricted OS and not provisioned to deploy - workloads.""" - TRANSITIONING = "Transitioning" - """EdgeMachine state when transitioning from initial OS to target OS.""" - PURPOSED = "Purposed" - """EdgeMachine state when machine configured with target OS to deploy workloads.""" - UPDATING = "Updating" - """EdgeMachine state when OS updates are in-progress.""" - RESETTING = "Resetting" - """EdgeMachine state when transitioning from target OS to restricted OS.""" - FAILED = "Failed" - """EdgeMachine failed state and only option to recover is to re-provisioning machine.""" - PREPARING = "Preparing" - """Preparing EdgeMachine.""" - - class ExtensionAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Aggregate state of Arc Extensions across the nodes in this HCI cluster. This reflects the overall status of the extension deployment and operation across all nodes. @@ -426,15 +346,6 @@ class HciEdgeDeviceJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Job to provide remote support to the device.""" -class HciJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ClusterJob Type supported.""" - - CONFIGURE_CVM = "ConfigureCVM" - """Job to CVM intent for the cluster.""" - CONFIGURE_SDN_INTEGRATION = "ConfigureSdnIntegration" - """Job to configure SDN (Software Defined Networking) integration for the cluster.""" - - class HealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Overall health state for update-specific health checks. Indicates whether the system is functioning correctly, has warnings or errors, or is undergoing a health evaluation. @@ -465,18 +376,6 @@ class IdentityProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): AD-less environments where Active Directory is not available or required.""" -class IgvmStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents the IGVM support status for the device.""" - - UNKNOWN = "Unknown" - """The IGVM status could not be determined due to a query failure or inconsistent system state.""" - ENABLED = "Enabled" - """IGVM support is enabled, indicating that confidential VM features are available on this device.""" - DISABLED = "Disabled" - """IGVM status is disabled, indicating that confidential VM features are not supported on this - device.""" - - class ImdsAttestation(str, Enum, metaclass=CaseInsensitiveEnumMeta): """IMDS attestation status of the cluster.""" @@ -486,15 +385,6 @@ class ImdsAttestation(str, Enum, metaclass=CaseInsensitiveEnumMeta): """IMDS attestation is enabled for the cluster.""" -class IpAssignmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """IP assignment types.""" - - AUTOMATIC = "Automatic" - """Automatic IP assignment.""" - MANUAL = "Manual" - """Manual IP assignment.""" - - class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Represents the various statuses a job can have throughout its lifecycle.""" @@ -657,13 +547,6 @@ class OemActivation(str, Enum, metaclass=CaseInsensitiveEnumMeta): """OEM activation is enabled for the cluster.""" -class OnboardingResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Onboarding resource type.""" - - HYBRID_COMPUTE_MACHINE = "HybridComputeMachine" - """Hybrid Compute Machine.""" - - class OperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended operation for a cluster.""" @@ -686,17 +569,6 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the operation is initiated by a user or system.""" -class OSOperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """OS Provision Operation type.""" - - PROVISION = "Provision" - """OS Provisioning operation.""" - UPDATE = "Update" - """OS Update operation.""" - RE_IMAGE = "ReImage" - """OS ReImage operation.""" - - class OverprovisioningRatio(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Overprovisioning ratio for S2D storage.""" @@ -708,31 +580,6 @@ class OverprovisioningRatio(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Overprovisioning ratio of 2.""" -class OwnerKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of owner key in the voucher.""" - - MICROSOFT_MANAGED = "MicrosoftManaged" - """Owner is Microsoft managed key.""" - - -class OwnershipVoucherValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Ownership Voucher validation Status.""" - - VALID = "Valid" - """Voucher evaluated as valid.""" - INVALID = "Invalid" - """Voucher evaluated as invalid.""" - - -class ProvisioningOsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents the provisioning operating system type.""" - - AZURE_LINUX = "AzureLinux" - """AzureLinux OS.""" - HCI = "HCI" - """HCI OS.""" - - class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the ArcSetting proxy resource.""" @@ -831,35 +678,6 @@ class RemoteSupportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Revoke previously enabled remote support for the cluster.""" -class SdnIntegrationIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether Software Defined Networking (SDN) integration should be enabled or disabled - for this deployment. - """ - - ENABLE = "Enable" - """Enable SDN integration for the deployment.""" - DISABLE = "Disable" - """Disable SDN integration for the deployment.""" - - -class SdnStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the current Software Defined Networking (SDN) status of the resource, which may be an - individual device or a cluster. - """ - - UNKNOWN = "Unknown" - """The SDN status could not be determined due to a failure in querying the SDN API service. This - may occur if the query script fails or if the system is in an inconsistent state. The domain - name will be null in this case.""" - DISABLED = "Disabled" - """SDN is not enabled on the resource. The domain name will be null. This is the default state - when SDN has not been configured.""" - ENABLED = "Enabled" - """SDN is successfully enabled on the resource. The domain name will be populated in the format - ``-nc.``. Customers may need to manage DNS settings to ensure proper - resolution.""" - - class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of secrets to store.""" @@ -867,15 +685,6 @@ class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Backup secrets type.""" -class SecretType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of secret used for authentication.""" - - KEY_VAULT = "KeyVault" - """Key Vault based authentication.""" - SSH_PUB_KEY = "SshPubKey" - """SSH Public Key based authentication.""" - - class ServiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the name of the service associated with the update or operation. This helps identify which system component or tool is involved. @@ -1013,11 +822,11 @@ class StatusLevelTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): class StorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Storage type supported for HCI Cluster.""" - S2D = "S2D" + S2_D = "S2D" """Storage Spaces Direct (S2D) storage type.""" SAN = "SAN" """Storage Area Network (SAN) storage type.""" - SANS2D = "SANS2D" + SANS2_D = "SANS2D" """Combined SAN and Storage Spaces Direct (SANS2D) storage type.""" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py index 8242c7edbdfb..3aa825ee8e9d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py @@ -12,7 +12,7 @@ from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload from .._utils.model_base import Model as _Model, rest_discriminator, rest_field -from ._enums import DeviceKind, EdgeDeviceKind, EdgeMachineJobType, HciEdgeDeviceJobType, HciJobType +from ._enums import DeviceKind, EdgeDeviceKind, HciEdgeDeviceJobType if TYPE_CHECKING: from .. import models as _models @@ -464,65 +464,6 @@ class AssemblyInfoPayload(_Model): """Url of assembly package for Validated Solution Recipe for AzureStackHCI Cluster.""" -class ChangeRingRequest(_Model): - """ChangeRingRequest. - - :ivar properties: - :vartype properties: ~azure.mgmt.azurestackhci.models.ChangeRingRequestProperties - """ - - properties: Optional["_models.ChangeRingRequestProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - properties: Optional["_models.ChangeRingRequestProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ChangeRingRequestProperties(_Model): - """ChangeRingRequestProperties. - - :ivar target_ring: The target ring for the cluster. - :vartype target_ring: str - """ - - target_ring: Optional[str] = rest_field( - name="targetRing", visibility=["read", "create", "update", "delete", "query"] - ) - """The target ring for the cluster.""" - - @overload - def __init__( - self, - *, - target_ring: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class CheckUpdatesRequest(_Model): """Request body for the check updates action on update summaries. @@ -553,39 +494,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClaimDeviceRequest(_Model): - """Request for claiming devices of the pool. - - :ivar devices: List of resource ids of the devices to be modified. Required. - :vartype devices: list[str] - :ivar claimed_by: Resource Id of group device belongs to. - :vartype claimed_by: str - """ - - devices: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of resource ids of the devices to be modified. Required.""" - claimed_by: Optional[str] = rest_field(name="claimedBy", visibility=["read", "create", "update", "delete", "query"]) - """Resource Id of group device belongs to.""" - - @overload - def __init__( - self, - *, - devices: list[str], - claimed_by: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class TrackedResource(Resource): """Tracked Resource. @@ -674,7 +582,6 @@ class Cluster(TrackedResource): "status", "connectivity_status", "cloud_id", - "ring", "cloud_management_endpoint", "aad_client_id", "aad_tenant_id", @@ -697,8 +604,6 @@ class Cluster(TrackedResource): "resource_provider_object_id", "secrets_locations", "cluster_pattern", - "confidential_vm_properties", - "sdn_properties", "local_availability_zones", "identity_provider", "storage_type", @@ -884,127 +789,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClusterJob(ProxyResource): - """Cluster Jobs resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.azurestackhci.models.ClusterJobProperties - """ - - properties: Optional["_models.ClusterJobProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ClusterJobProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ClusterJobProperties(_Model): - """Cluster Job properties. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - HciConfigureCvmJobProperties, HciConfigureSdnIntegrationJobProperties - - :ivar job_type: Job Type to support polymorphic resource. Required. Known values are: - "ConfigureCVM" and "ConfigureSdnIntegration". - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.HciJobType - :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and - "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar job_id: Unique, immutable job id. - :vartype job_id: str - :ivar start_time_utc: The UTC date and time at which the job started. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: The UTC date and time at which the job completed. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Cluster job. Known values are: "NotSpecified", "ValidationInProgress", - "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", "DeploymentFailed", - "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and "Scheduled". - :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar reported_properties: Reported properties for job. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.JobReportedProperties - """ - - __mapping__: dict[str, _Model] = {} - job_type: str = rest_discriminator(name="jobType", visibility=["read", "create"]) - """Job Type to support polymorphic resource. Required. Known values are: \"ConfigureCVM\" and - \"ConfigureSdnIntegration\".""" - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = rest_field( - name="deploymentMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment mode to trigger job. Known values are: \"Validate\" and \"Deploy\".""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Job provisioning state. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", - \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", - \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", - \"InProgress\", \"Accepted\", \"Provisioning\", and \"DisableInProgress\".""" - job_id: Optional[str] = rest_field(name="jobId", visibility=["read"]) - """Unique, immutable job id.""" - start_time_utc: Optional[datetime.datetime] = rest_field(name="startTimeUtc", visibility=["read"], format="rfc3339") - """The UTC date and time at which the job started.""" - end_time_utc: Optional[datetime.datetime] = rest_field(name="endTimeUtc", visibility=["read"], format="rfc3339") - """The UTC date and time at which the job completed.""" - status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"]) - """Status of Cluster job. Known values are: \"NotSpecified\", \"ValidationInProgress\", - \"ValidationSuccess\", \"ValidationFailed\", \"DeploymentInProgress\", \"DeploymentFailed\", - \"DeploymentSuccess\", \"Succeeded\", \"Failed\", \"Canceled\", \"Paused\", and \"Scheduled\".""" - reported_properties: Optional["_models.JobReportedProperties"] = rest_field( - name="reportedProperties", visibility=["read"] - ) - """Reported properties for job.""" - - @overload - def __init__( - self, - *, - job_type: str, - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class ClusterNode(_Model): """Cluster node details. @@ -1226,8 +1010,6 @@ class ClusterProperties(_Model): :vartype connectivity_status: str or ~azure.mgmt.azurestackhci.models.ConnectivityStatus :ivar cloud_id: Unique, immutable resource id. :vartype cloud_id: str - :ivar ring: The ring to which this cluster belongs to. - :vartype ring: str :ivar cloud_management_endpoint: Endpoint configured for management from the Azure portal. :vartype cloud_management_endpoint: str :ivar aad_client_id: App id of cluster AAD identity. @@ -1278,11 +1060,6 @@ class ClusterProperties(_Model): :ivar cluster_pattern: Supported Storage Type for HCI Cluster. Known values are: "Standard" and "RackAware". :vartype cluster_pattern: str or ~azure.mgmt.azurestackhci.models.ClusterPattern - :ivar confidential_vm_properties: Represents the Confidential Virtual Machine (CVM) support - intent and current status for the cluster resource. - :vartype confidential_vm_properties: ~azure.mgmt.azurestackhci.models.ConfidentialVmProperties - :ivar sdn_properties: Software Defined Networking Properties of the cluster. - :vartype sdn_properties: ~azure.mgmt.azurestackhci.models.ClusterSdnProperties :ivar local_availability_zones: Local Availability Zone information for HCI cluster. :vartype local_availability_zones: list[~azure.mgmt.azurestackhci.models.LocalAvailabilityZones] @@ -1318,8 +1095,6 @@ class ClusterProperties(_Model): \"Disconnected\", and \"NotSpecified\".""" cloud_id: Optional[str] = rest_field(name="cloudId", visibility=["read"]) """Unique, immutable resource id.""" - ring: Optional[str] = rest_field(visibility=["read"]) - """The ring to which this cluster belongs to.""" cloud_management_endpoint: Optional[str] = rest_field( name="cloudManagementEndpoint", visibility=["read", "create", "update", "delete", "query"] ) @@ -1399,13 +1174,6 @@ class ClusterProperties(_Model): name="clusterPattern", visibility=["read"] ) """Supported Storage Type for HCI Cluster. Known values are: \"Standard\" and \"RackAware\".""" - confidential_vm_properties: Optional["_models.ConfidentialVmProperties"] = rest_field( - name="confidentialVmProperties", visibility=["read"] - ) - """Represents the Confidential Virtual Machine (CVM) support intent and current status for the - cluster resource.""" - sdn_properties: Optional["_models.ClusterSdnProperties"] = rest_field(name="sdnProperties", visibility=["read"]) - """Software Defined Networking Properties of the cluster.""" local_availability_zones: Optional[list["_models.LocalAvailabilityZones"]] = rest_field( name="localAvailabilityZones", visibility=["read", "create", "update", "delete", "query"] ) @@ -1543,197 +1311,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SdnProperties(_Model): - """Represents the Software Defined Networking (SDN) configuration state. - - :ivar sdn_status: Indicates the current Software Defined Networking (SDN) status of the - resource, which may be an individual device or a cluster. Known values are: "Unknown", - "Disabled", and "Enabled". - :vartype sdn_status: str or ~azure.mgmt.azurestackhci.models.SdnStatus - :ivar sdn_domain_name: The fully qualified domain name (FQDN) associated with the SDN - deployment. This value is propagated from the Device Management Extension to the cluster - resource. It is typically in the format ``-nc.`` when SDN is enabled. May be - null or absent in unsupported or disabled states. - :vartype sdn_domain_name: str - :ivar sdn_api_address: Represents the API address for the SDN deployment. - :vartype sdn_api_address: str - """ - - sdn_status: Optional[Union[str, "_models.SdnStatus"]] = rest_field(name="sdnStatus", visibility=["read"]) - """Indicates the current Software Defined Networking (SDN) status of the resource, which may be an - individual device or a cluster. Known values are: \"Unknown\", \"Disabled\", and \"Enabled\".""" - sdn_domain_name: Optional[str] = rest_field(name="sdnDomainName", visibility=["read"]) - """The fully qualified domain name (FQDN) associated with the SDN deployment. This value is - propagated from the Device Management Extension to the cluster resource. It is typically in the - format ``-nc.`` when SDN is enabled. May be null or absent in unsupported or - disabled states.""" - sdn_api_address: Optional[str] = rest_field(name="sdnApiAddress", visibility=["read"]) - """Represents the API address for the SDN deployment.""" - - -class ClusterSdnProperties(SdnProperties): - """Represents the Software Defined Networking (SDN) configuration state of the Azure Stack HCI - cluster. - - :ivar sdn_status: Indicates the current Software Defined Networking (SDN) status of the - resource, which may be an individual device or a cluster. Known values are: "Unknown", - "Disabled", and "Enabled". - :vartype sdn_status: str or ~azure.mgmt.azurestackhci.models.SdnStatus - :ivar sdn_domain_name: The fully qualified domain name (FQDN) associated with the SDN - deployment. This value is propagated from the Device Management Extension to the cluster - resource. It is typically in the format ``-nc.`` when SDN is enabled. May be - null or absent in unsupported or disabled states. - :vartype sdn_domain_name: str - :ivar sdn_api_address: Represents the API address for the SDN deployment. - :vartype sdn_api_address: str - :ivar sdn_integration_intent: Indicates whether Software Defined Networking (SDN) integration - should be enabled or disabled for this deployment. Known values are: "Enable" and "Disable". - :vartype sdn_integration_intent: str or ~azure.mgmt.azurestackhci.models.SdnIntegrationIntent - """ - - sdn_integration_intent: Optional[Union[str, "_models.SdnIntegrationIntent"]] = rest_field( - name="sdnIntegrationIntent", visibility=["read"] - ) - """Indicates whether Software Defined Networking (SDN) integration should be enabled or disabled - for this deployment. Known values are: \"Enable\" and \"Disable\".""" - - -class ConfidentialVmProfile(_Model): - """Represents the Confidential Virtual Machine (CVM) configuration status for an edge device. It - includes the current IGVM support state and detailed component-level status information. - - :ivar igvm_status: Indicates whether Independent Guest Virtual Machine (IGVM) support is - available on the device. This will be 'Enabled' if the device supports CVMs, 'Disabled' if not, - and 'Unknown' if the status cannot be determined. Known values are: "Unknown", "Enabled", and - "Disabled". - :vartype igvm_status: str or ~azure.mgmt.azurestackhci.models.IgvmStatus - :ivar status_details: Provides detailed status entries for IGVM-related components, including - deployment status, compatibility checks, and error diagnostics. - :vartype status_details: list[~azure.mgmt.azurestackhci.models.IgvmStatusDetail] - """ - - igvm_status: Optional[Union[str, "_models.IgvmStatus"]] = rest_field(name="igvmStatus", visibility=["read"]) - """Indicates whether Independent Guest Virtual Machine (IGVM) support is available on the device. - This will be 'Enabled' if the device supports CVMs, 'Disabled' if not, and 'Unknown' if the - status cannot be determined. Known values are: \"Unknown\", \"Enabled\", and \"Disabled\".""" - status_details: Optional[list["_models.IgvmStatusDetail"]] = rest_field( - name="statusDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """Provides detailed status entries for IGVM-related components, including deployment status, - compatibility checks, and error diagnostics.""" - - @overload - def __init__( - self, - *, - status_details: Optional[list["_models.IgvmStatusDetail"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ConfidentialVmProperties(_Model): - """Represents the Confidential Virtual Machine (CVM) support intent and current status for the - cluster resource. - - :ivar confidential_vm_intent: Captures the customer's intent to enable or disable CVM support - on the cluster, either during initial deployment (Day-0) or at a later stage (Day-N). Known - values are: "Enable" and "Disable". - :vartype confidential_vm_intent: str or ~azure.mgmt.azurestackhci.models.ConfidentialVmIntent - :ivar confidential_vm_status: Captures the current status of CVM support on the cluster. Known - values are: "Enabled", "PartiallyEnabled", and "Disabled". - :vartype confidential_vm_status: str or ~azure.mgmt.azurestackhci.models.ConfidentialVmStatus - :ivar confidential_vm_status_summary: Additional context about CVM support on the cluster, such - as reasons for partial enablement or hardware constraints. - :vartype confidential_vm_status_summary: str - """ - - confidential_vm_intent: Optional[Union[str, "_models.ConfidentialVmIntent"]] = rest_field( - name="confidentialVmIntent", visibility=["read"] - ) - """Captures the customer's intent to enable or disable CVM support on the cluster, either during - initial deployment (Day-0) or at a later stage (Day-N). Known values are: \"Enable\" and - \"Disable\".""" - confidential_vm_status: Optional[Union[str, "_models.ConfidentialVmStatus"]] = rest_field( - name="confidentialVmStatus", visibility=["read"] - ) - """Captures the current status of CVM support on the cluster. Known values are: \"Enabled\", - \"PartiallyEnabled\", and \"Disabled\".""" - confidential_vm_status_summary: Optional[str] = rest_field(name="confidentialVmStatusSummary", visibility=["read"]) - """Additional context about CVM support on the cluster, such as reasons for partial enablement or - hardware constraints.""" - - -class ContentPayload(_Model): - """Represents details of a specific update content payload. - - :ivar url: Represents url of a update payload. - :vartype url: str - :ivar hash: Represents hash of a update payload. - :vartype hash: str - :ivar hash_algorithm: Represents hash algorithm of a update payload. - :vartype hash_algorithm: str - :ivar identifier: Represents identifier of a update payload. - :vartype identifier: str - :ivar package_size_in_bytes: Represents size in bytes of a update payload. - :vartype package_size_in_bytes: str - :ivar group: Represents the group of a update payload. - :vartype group: str - :ivar file_name: Represents the file name of a update payload. - :vartype file_name: str - """ - - url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Represents url of a update payload.""" - hash: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Represents hash of a update payload.""" - hash_algorithm: Optional[str] = rest_field( - name="hashAlgorithm", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents hash algorithm of a update payload.""" - identifier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Represents identifier of a update payload.""" - package_size_in_bytes: Optional[str] = rest_field( - name="packageSizeInBytes", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents size in bytes of a update payload.""" - group: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Represents the group of a update payload.""" - file_name: Optional[str] = rest_field(name="fileName", visibility=["read", "create", "update", "delete", "query"]) - """Represents the file name of a update payload.""" - - @overload - def __init__( - self, - *, - url: Optional[str] = None, - hash: Optional[str] = None, - hash_algorithm: Optional[str] = None, - identifier: Optional[str] = None, - package_size_in_bytes: Optional[str] = None, - group: Optional[str] = None, - file_name: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class DefaultExtensionDetails(_Model): """Properties for a particular default extension category. @@ -2692,27 +2269,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeviceDetail(_Model): - """Device details. +class DnsZones(_Model): + """Details of the DNS Zones to be configured. - :ivar device_resource_id: Resource Id of the device. - :vartype device_resource_id: str - :ivar claimed_by: Resource Id of group device belongs to. - :vartype claimed_by: str + :ivar dns_zone_name: Name of the DNS Zone to be configured. + :vartype dns_zone_name: str + :ivar dns_forwarder: Forwarder details of the DNS Zone to be configured. + :vartype dns_forwarder: list[str] """ - device_resource_id: Optional[str] = rest_field( - name="deviceResourceId", visibility=["read", "create", "update", "delete", "query"] + dns_zone_name: Optional[str] = rest_field( + name="dnsZoneName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the DNS Zone to be configured.""" + dns_forwarder: Optional[list[str]] = rest_field( + name="dnsForwarder", visibility=["read", "create", "update", "delete", "query"] ) - """Resource Id of the device.""" - claimed_by: Optional[str] = rest_field(name="claimedBy", visibility=["read"]) - """Resource Id of group device belongs to.""" + """Forwarder details of the DNS Zone to be configured.""" @overload def __init__( self, *, - device_resource_id: Optional[str] = None, + dns_zone_name: Optional[str] = None, + dns_forwarder: Optional[list[str]] = None, ) -> None: ... @overload @@ -2726,82 +2306,56 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DevicePool(TrackedResource): - """DevicePool details. +class EceActionStatus(_Model): + """The ECE action plan deployment status for AzureStackHCI Cluster. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.azurestackhci.models.DevicePoolProperties - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.azurestackhci.models.ManagedServiceIdentity + :ivar status: Status of ECE action AzureStackHCI Cluster Deployment. + :vartype status: str + :ivar steps: List of steps of AzureStackHCI Cluster Deployment. + :vartype steps: list[~azure.mgmt.azurestackhci.models.DeploymentStep] """ - properties: Optional["_models.DevicePoolProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.DevicePoolProperties"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) + status: Optional[str] = rest_field(visibility=["read"]) + """Status of ECE action AzureStackHCI Cluster Deployment.""" + steps: Optional[list["_models.DeploymentStep"]] = rest_field(visibility=["read"]) + """List of steps of AzureStackHCI Cluster Deployment.""" -class DevicePoolPatch(_Model): - """Properties for patching Device Pool. +class EceDeploymentSecrets(_Model): + """Protected parameters list stored in keyvault. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.azurestackhci.models.ManagedServiceIdentity + :ivar secret_name: Secret name stored in keyvault. + :vartype secret_name: str + :ivar ece_secret_name: Secret name expected for Enterprise Cloud Engine (ECE) deployment. Known + values are: "AzureStackLCMUserCredential", "DefaultARBApplication", "LocalAdminCredential", and + "WitnessStorageKey". + :vartype ece_secret_name: str or ~azure.mgmt.azurestackhci.models.EceSecrets + :ivar secret_location: Secret URI stored in keyvault. + :vartype secret_location: str """ - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + secret_name: Optional[str] = rest_field( + name="secretName", visibility=["read", "create", "update", "delete", "query"] ) - """The managed service identities assigned to this resource.""" + """Secret name stored in keyvault.""" + ece_secret_name: Optional[Union[str, "_models.EceSecrets"]] = rest_field( + name="eceSecretName", visibility=["read", "create", "update", "delete", "query"] + ) + """Secret name expected for Enterprise Cloud Engine (ECE) deployment. Known values are: + \"AzureStackLCMUserCredential\", \"DefaultARBApplication\", \"LocalAdminCredential\", and + \"WitnessStorageKey\".""" + secret_location: Optional[str] = rest_field( + name="secretLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Secret URI stored in keyvault.""" @overload def __init__( self, *, - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, + secret_name: Optional[str] = None, + ece_secret_name: Optional[Union[str, "_models.EceSecrets"]] = None, + secret_location: Optional[str] = None, ) -> None: ... @overload @@ -2815,101 +2369,72 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DevicePoolProperties(_Model): - """Properties for device pool. +class EceReportedProperties(_Model): + """The DeploymentStatus of AzureStackHCI Cluster. - :ivar provisioning_state: The provisioning state of a resource. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar cloud_id: Unique, immutable resource id. - :vartype cloud_id: str - :ivar devices: List of machines in device pool. - :vartype devices: list[~azure.mgmt.azurestackhci.models.DeviceDetail] - :ivar custom_location_resource_id: Custom Location Resource Id for the pool. - :vartype custom_location_resource_id: str - :ivar custom_location_name: Custom Location Name for the pool, default: -CL. - :vartype custom_location_name: str - :ivar managed_resource_group: Managed resource group name for the pool. - :vartype managed_resource_group: str - :ivar operation_details: operation status details for device pool. - :vartype operation_details: list[~azure.mgmt.azurestackhci.models.OperationDetail] + :ivar validation_status: validation status of AzureStackHCI Cluster Deployment. + :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar deployment_status: Deployment status of AzureStackHCI Cluster Deployment. + :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus """ - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provisioning state of a resource. Known values are: \"NotSpecified\", \"Error\", - \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", - \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", - \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and - \"DisableInProgress\".""" - cloud_id: Optional[str] = rest_field(name="cloudId", visibility=["read"]) - """Unique, immutable resource id.""" - devices: Optional[list["_models.DeviceDetail"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of machines in device pool.""" - custom_location_resource_id: Optional[str] = rest_field(name="customLocationResourceId", visibility=["read"]) - """Custom Location Resource Id for the pool.""" - custom_location_name: Optional[str] = rest_field( - name="customLocationName", visibility=["read", "create", "update", "delete", "query"] - ) - """Custom Location Name for the pool, default: -CL.""" - managed_resource_group: Optional[str] = rest_field( - name="managedResourceGroup", visibility=["read", "create", "update", "delete", "query"] - ) - """Managed resource group name for the pool.""" - operation_details: Optional[list["_models.OperationDetail"]] = rest_field( - name="operationDetails", visibility=["read"] - ) - """operation status details for device pool.""" + validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) + """validation status of AzureStackHCI Cluster Deployment.""" + deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) + """Deployment status of AzureStackHCI Cluster Deployment.""" - @overload - def __init__( - self, - *, - devices: Optional[list["_models.DeviceDetail"]] = None, - custom_location_name: Optional[str] = None, - managed_resource_group: Optional[str] = None, - ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ +class ExtensionResource(Resource): + """The base extension resource. - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + """ -class DnsZones(_Model): - """Details of the DNS Zones to be configured. +class EdgeDevice(ExtensionResource): + """Edge device resource. - :ivar dns_zone_name: Name of the DNS Zone to be configured. - :vartype dns_zone_name: str - :ivar dns_forwarder: Forwarder details of the DNS Zone to be configured. - :vartype dns_forwarder: list[str] + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + HciEdgeDevice + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. Required. "HCI" + :vartype kind: str or ~azure.mgmt.azurestackhci.models.DeviceKind """ - dns_zone_name: Optional[str] = rest_field( - name="dnsZoneName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the DNS Zone to be configured.""" - dns_forwarder: Optional[list[str]] = rest_field( - name="dnsForwarder", visibility=["read", "create", "update", "delete", "query"] - ) - """Forwarder details of the DNS Zone to be configured.""" + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create"]) + """Metadata used by portal/tooling/etc to render different UX experiences for resources of the + same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource + provider must validate and persist this value. Required. \"HCI\"""" @overload def __init__( self, *, - dns_zone_name: Optional[str] = None, - dns_forwarder: Optional[list[str]] = None, + kind: str, ) -> None: ... @overload @@ -2923,664 +2448,42 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EdgeMachineJobProperties(_Model): - """EdgeMachine Job properties. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - EdgeMachineCollectLogJobProperties, DownloadOsJobProperties, ProvisionOsJobProperties, - EdgeMachineRemoteSupportJobProperties +class EdgeDeviceDisks(_Model): + """Represents a storage disk on the device. - :ivar job_type: Job Type to support polymorphic resource. Required. Known values are: - "CollectLog", "RemoteSupport", "ProvisionOs", and "DownloadOs". - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.EdgeMachineJobType - :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and - "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar job_id: Unique, immutable job id. - :vartype job_id: str - :ivar start_time_utc: The UTC date and time at which the job started. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: The UTC date and time at which the job completed. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Edge device job. Known values are: "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and - "Scheduled". - :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar error: error details. - :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + :ivar id: The unique identifier of the disk. Required. + :vartype id: str + :ivar size_in_bytes: The size of the disk in bytes. + :vartype size_in_bytes: str + :ivar type: The type of the disk. For example, S2D or SAN. + :vartype type: str + :ivar model: Model number of the hardware. + :vartype model: str + :ivar manufacturer: The manufacturer of the disk. + :vartype manufacturer: str + :ivar is_supported: Indicates whether the manufacturer is supported. + :vartype is_supported: bool """ - __mapping__: dict[str, _Model] = {} - job_type: str = rest_discriminator(name="jobType", visibility=["read", "create"]) - """Job Type to support polymorphic resource. Required. Known values are: \"CollectLog\", - \"RemoteSupport\", \"ProvisionOs\", and \"DownloadOs\".""" - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = rest_field( - name="deploymentMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment mode to trigger job. Known values are: \"Validate\" and \"Deploy\".""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Job provisioning state. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", - \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", - \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", - \"InProgress\", \"Accepted\", \"Provisioning\", and \"DisableInProgress\".""" - job_id: Optional[str] = rest_field(name="jobId", visibility=["read"]) - """Unique, immutable job id.""" - start_time_utc: Optional[datetime.datetime] = rest_field(name="startTimeUtc", visibility=["read"], format="rfc3339") - """The UTC date and time at which the job started.""" - end_time_utc: Optional[datetime.datetime] = rest_field(name="endTimeUtc", visibility=["read"], format="rfc3339") - """The UTC date and time at which the job completed.""" - status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"]) - """Status of Edge device job. Known values are: \"NotSpecified\", \"ValidationInProgress\", - \"ValidationSuccess\", \"ValidationFailed\", \"DeploymentInProgress\", \"DeploymentFailed\", - \"DeploymentSuccess\", \"Succeeded\", \"Failed\", \"Canceled\", \"Paused\", and \"Scheduled\".""" - error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read"]) - """error details.""" - - @overload - def __init__( - self, - *, - job_type: str, - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + id: str = rest_field(visibility=["read"]) + """The unique identifier of the disk. Required.""" + size_in_bytes: Optional[str] = rest_field(name="sizeInBytes", visibility=["read"]) + """The size of the disk in bytes.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the disk. For example, S2D or SAN.""" + model: Optional[str] = rest_field(visibility=["read"]) + """Model number of the hardware.""" + manufacturer: Optional[str] = rest_field(visibility=["read"]) + """The manufacturer of the disk.""" + is_supported: Optional[bool] = rest_field(name="isSupported", visibility=["read"]) + """Indicates whether the manufacturer is supported.""" - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) +class EdgeDeviceJob(ExtensionResource): + """EdgeDevice Jobs resource. -class DownloadOsJobProperties(EdgeMachineJobProperties, discriminator="DownloadOs"): - """Represents the properties of Download Os job. - - :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and - "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar job_id: Unique, immutable job id. - :vartype job_id: str - :ivar start_time_utc: The UTC date and time at which the job started. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: The UTC date and time at which the job completed. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Edge device job. Known values are: "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and - "Scheduled". - :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar error: error details. - :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail - :ivar job_type: Job Type to support polymorphic resource. Required. Job to download OS packages - on to the device. - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.DOWNLOAD_OS - :ivar download_request: Download OS request. Required. - :vartype download_request: ~azure.mgmt.azurestackhci.models.DownloadRequest - :ivar reported_properties: Reported Properties for Download Os job. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.ProvisionOsReportedProperties - """ - - job_type: Literal[EdgeMachineJobType.DOWNLOAD_OS] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Job Type to support polymorphic resource. Required. Job to download OS packages on to the - device.""" - download_request: "_models.DownloadRequest" = rest_field( - name="downloadRequest", visibility=["read", "create", "update", "delete", "query"] - ) - """Download OS request. Required.""" - reported_properties: Optional["_models.ProvisionOsReportedProperties"] = rest_field( - name="reportedProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Reported Properties for Download Os job.""" - - @overload - def __init__( - self, - *, - download_request: "_models.DownloadRequest", - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, - reported_properties: Optional["_models.ProvisionOsReportedProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = EdgeMachineJobType.DOWNLOAD_OS # type: ignore - - -class DownloadOsProfile(_Model): - """Operating system profile. - - :ivar os_name: Name of the operating system. - :vartype os_name: str - :ivar os_type: Type of the operating system. - :vartype os_type: str - :ivar os_version: Version of the operating system. - :vartype os_version: str - :ivar os_image_location: Location of the operating system image. - :vartype os_image_location: str - :ivar vsr_version: Validated Solution Recipe version to be used for the job. - :vartype vsr_version: str - :ivar image_hash: Hash of the OS package downloaded. - :vartype image_hash: str - :ivar gpg_pub_key: GPG Public Key used for package verification. - :vartype gpg_pub_key: str - """ - - os_name: Optional[str] = rest_field(name="osName", visibility=["read", "create", "update", "delete", "query"]) - """Name of the operating system.""" - os_type: Optional[str] = rest_field(name="osType", visibility=["read", "create", "update", "delete", "query"]) - """Type of the operating system.""" - os_version: Optional[str] = rest_field(name="osVersion", visibility=["read", "create", "update", "delete", "query"]) - """Version of the operating system.""" - os_image_location: Optional[str] = rest_field( - name="osImageLocation", visibility=["read", "create", "update", "delete", "query"] - ) - """Location of the operating system image.""" - vsr_version: Optional[str] = rest_field( - name="vsrVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Validated Solution Recipe version to be used for the job.""" - image_hash: Optional[str] = rest_field(name="imageHash", visibility=["read", "create", "update", "delete", "query"]) - """Hash of the OS package downloaded.""" - gpg_pub_key: Optional[str] = rest_field( - name="gpgPubKey", visibility=["read", "create", "update", "delete", "query"] - ) - """GPG Public Key used for package verification.""" - - @overload - def __init__( - self, - *, - os_name: Optional[str] = None, - os_type: Optional[str] = None, - os_version: Optional[str] = None, - os_image_location: Optional[str] = None, - vsr_version: Optional[str] = None, - image_hash: Optional[str] = None, - gpg_pub_key: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DownloadRequest(_Model): - """Download Request properties. - - :ivar target: Target operating system to support polymorphic resource. Required. Known values - are: "AzureLinux" and "HCI". - :vartype target: str or ~azure.mgmt.azurestackhci.models.ProvisioningOsType - :ivar os_profile: Operating system profile. Required. - :vartype os_profile: ~azure.mgmt.azurestackhci.models.DownloadOsProfile - """ - - target: Union[str, "_models.ProvisioningOsType"] = rest_field(visibility=["read", "create"]) - """Target operating system to support polymorphic resource. Required. Known values are: - \"AzureLinux\" and \"HCI\".""" - os_profile: "_models.DownloadOsProfile" = rest_field( - name="osProfile", visibility=["read", "create", "update", "delete", "query"] - ) - """Operating system profile. Required.""" - - @overload - def __init__( - self, - *, - target: Union[str, "_models.ProvisioningOsType"], - os_profile: "_models.DownloadOsProfile", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EceActionStatus(_Model): - """The ECE action plan deployment status for AzureStackHCI Cluster. - - :ivar status: Status of ECE action AzureStackHCI Cluster Deployment. - :vartype status: str - :ivar steps: List of steps of AzureStackHCI Cluster Deployment. - :vartype steps: list[~azure.mgmt.azurestackhci.models.DeploymentStep] - """ - - status: Optional[str] = rest_field(visibility=["read"]) - """Status of ECE action AzureStackHCI Cluster Deployment.""" - steps: Optional[list["_models.DeploymentStep"]] = rest_field(visibility=["read"]) - """List of steps of AzureStackHCI Cluster Deployment.""" - - -class EceDeploymentSecrets(_Model): - """Protected parameters list stored in keyvault. - - :ivar secret_name: Secret name stored in keyvault. - :vartype secret_name: str - :ivar ece_secret_name: Secret name expected for Enterprise Cloud Engine (ECE) deployment. Known - values are: "AzureStackLCMUserCredential", "DefaultARBApplication", "LocalAdminCredential", and - "WitnessStorageKey". - :vartype ece_secret_name: str or ~azure.mgmt.azurestackhci.models.EceSecrets - :ivar secret_location: Secret URI stored in keyvault. - :vartype secret_location: str - """ - - secret_name: Optional[str] = rest_field( - name="secretName", visibility=["read", "create", "update", "delete", "query"] - ) - """Secret name stored in keyvault.""" - ece_secret_name: Optional[Union[str, "_models.EceSecrets"]] = rest_field( - name="eceSecretName", visibility=["read", "create", "update", "delete", "query"] - ) - """Secret name expected for Enterprise Cloud Engine (ECE) deployment. Known values are: - \"AzureStackLCMUserCredential\", \"DefaultARBApplication\", \"LocalAdminCredential\", and - \"WitnessStorageKey\".""" - secret_location: Optional[str] = rest_field( - name="secretLocation", visibility=["read", "create", "update", "delete", "query"] - ) - """Secret URI stored in keyvault.""" - - @overload - def __init__( - self, - *, - secret_name: Optional[str] = None, - ece_secret_name: Optional[Union[str, "_models.EceSecrets"]] = None, - secret_location: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EceReportedProperties(_Model): - """The DeploymentStatus of AzureStackHCI Cluster. - - :ivar validation_status: validation status of AzureStackHCI Cluster Deployment. - :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - :ivar deployment_status: Deployment status of AzureStackHCI Cluster Deployment. - :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - """ - - validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) - """validation status of AzureStackHCI Cluster Deployment.""" - deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) - """Deployment status of AzureStackHCI Cluster Deployment.""" - - -class ExtensionResource(Resource): - """The base extension resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - """ - - -class EdgeDevice(ExtensionResource): - """Edge device resource. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - HciEdgeDevice - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. Required. "HCI" - :vartype kind: str or ~azure.mgmt.azurestackhci.models.DeviceKind - """ - - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource - provider must validate and persist this value. Required. \"HCI\"""" - - @overload - def __init__( - self, - *, - kind: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EdgeDeviceDisks(_Model): - """Represents a storage disk on the device. - - :ivar id: The unique identifier of the disk. Required. - :vartype id: str - :ivar size_in_bytes: The size of the disk in bytes. - :vartype size_in_bytes: str - :ivar type: The type of the disk. For example, S2D or SAN. - :vartype type: str - """ - - id: str = rest_field(visibility=["read"]) - """The unique identifier of the disk. Required.""" - size_in_bytes: Optional[str] = rest_field(name="sizeInBytes", visibility=["read"]) - """The size of the disk in bytes.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the disk. For example, S2D or SAN.""" - - -class EdgeDeviceJob(ExtensionResource): - """EdgeDevice Jobs resource. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - HciEdgeDeviceJob - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for - resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, - the resource provider must validate and persist this value. Required. "HCI" - :vartype kind: str or ~azure.mgmt.azurestackhci.models.EdgeDeviceKind - """ - - __mapping__: dict[str, _Model] = {} - kind: str = rest_discriminator(name="kind", visibility=["read", "create"]) - """Metadata used by portal/tooling/etc to render different UX experiences for resources of the - same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource - provider must validate and persist this value. Required. \"HCI\"""" - - @overload - def __init__( - self, - *, - kind: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EdgeDeviceProperties(_Model): - """Edge Device properties. - - :ivar device_configuration: Device Configuration. - :vartype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration - :ivar provisioning_state: Provisioning state of edgeDevice resource. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - """ - - device_configuration: Optional["_models.DeviceConfiguration"] = rest_field( - name="deviceConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Device Configuration.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state of edgeDevice resource. Known values are: \"NotSpecified\", \"Error\", - \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", - \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", - \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and - \"DisableInProgress\".""" - - @overload - def __init__( - self, - *, - device_configuration: Optional["_models.DeviceConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EdgeMachine(TrackedResource): - """EdgeMachine details. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.azurestackhci.models.EdgeMachineProperties - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.azurestackhci.models.ManagedServiceIdentity - """ - - properties: Optional["_models.EdgeMachineProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.EdgeMachineProperties"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EdgeMachineCollectLogJobProperties(EdgeMachineJobProperties, discriminator="CollectLog"): - """Properties for pausing a server in the cluster. - - :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and - "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar job_id: Unique, immutable job id. - :vartype job_id: str - :ivar start_time_utc: The UTC date and time at which the job started. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: The UTC date and time at which the job completed. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Edge device job. Known values are: "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and - "Scheduled". - :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar error: error details. - :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail - :ivar job_type: ClusterJob Type to support polymorphic resource. Required. Job to collect logs - from the device. - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.COLLECT_LOG - :ivar from_date: From date for log collection. Required. - :vartype from_date: ~datetime.datetime - :ivar to_date: To date for log collection. Required. - :vartype to_date: ~datetime.datetime - :ivar last_log_generated: To date for log collection. - :vartype last_log_generated: ~datetime.datetime - :ivar reported_properties: log collection job reported properties. - :vartype reported_properties: - ~azure.mgmt.azurestackhci.models.EdgeMachineCollectLogJobReportedProperties - """ - - job_type: Literal[EdgeMachineJobType.COLLECT_LOG] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """ClusterJob Type to support polymorphic resource. Required. Job to collect logs from the device.""" - from_date: datetime.datetime = rest_field( - name="fromDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """From date for log collection. Required.""" - to_date: datetime.datetime = rest_field( - name="toDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """To date for log collection. Required.""" - last_log_generated: Optional[datetime.datetime] = rest_field( - name="lastLogGenerated", visibility=["read"], format="rfc3339" - ) - """To date for log collection.""" - reported_properties: Optional["_models.EdgeMachineCollectLogJobReportedProperties"] = rest_field( - name="reportedProperties", visibility=["read"] - ) - """log collection job reported properties.""" - - @overload - def __init__( - self, - *, - from_date: datetime.datetime, - to_date: datetime.datetime, - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = EdgeMachineJobType.COLLECT_LOG # type: ignore - - -class EdgeMachineCollectLogJobReportedProperties(_Model): # pylint: disable=name-too-long - """Represents the reported properties of a log collection job. - - :ivar percent_complete: The percentage of the job that is complete. - :vartype percent_complete: int - :ivar validation_status: Validation status of job. - :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - :ivar deployment_status: Deployment status of job. - :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - :ivar log_collection_session_details: Details of the log collection session. - :vartype log_collection_session_details: - list[~azure.mgmt.azurestackhci.models.LogCollectionJobSession] - """ - - percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) - """The percentage of the job that is complete.""" - validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) - """Validation status of job.""" - deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) - """Deployment status of job.""" - log_collection_session_details: Optional[list["_models.LogCollectionJobSession"]] = rest_field( - name="logCollectionSessionDetails", visibility=["read"] - ) - """Details of the log collection session.""" - - -class EdgeMachineJob(ProxyResource): - """Cluster Jobs resource. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + HciEdgeDeviceJob :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -3591,359 +2494,25 @@ class EdgeMachineJob(ProxyResource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.azurestackhci.models.EdgeMachineJobProperties - """ - - properties: Optional["_models.EdgeMachineJobProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.EdgeMachineJobProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EdgeMachineNetworkProfile(_Model): - """NetworkProfile of edge machine. - - :ivar nic_details: List of Network Interface Card (NIC) Details of edge machine. - :vartype nic_details: list[~azure.mgmt.azurestackhci.models.EdgeMachineNicDetail] - :ivar switch_details: List of switch Details of edge machine. - :vartype switch_details: list[~azure.mgmt.azurestackhci.models.SwitchDetail] - """ - - nic_details: Optional[list["_models.EdgeMachineNicDetail"]] = rest_field(name="nicDetails", visibility=["read"]) - """List of Network Interface Card (NIC) Details of edge machine.""" - switch_details: Optional[list["_models.SwitchDetail"]] = rest_field(name="switchDetails", visibility=["read"]) - """List of switch Details of edge machine.""" - - -class EdgeMachineNicDetail(_Model): - """Network Interface Card (NIC) Details of edge machine. - - :ivar adapter_name: Adapter Name of NIC. - :vartype adapter_name: str - :ivar interface_description: Interface Description of NIC. - :vartype interface_description: str - :ivar component_id: Component Id of NIC. - :vartype component_id: str - :ivar driver_version: Driver Version of NIC. - :vartype driver_version: str - :ivar ip4_address: Subnet Mask of NIC. - :vartype ip4_address: str - :ivar subnet_mask: Subnet Mask of NIC. - :vartype subnet_mask: str - :ivar default_gateway: Default Gateway of NIC. - :vartype default_gateway: str - :ivar dns_servers: DNS Servers for NIC. - :vartype dns_servers: list[str] - :ivar default_isolation_id: Default Isolation of Management NIC. - :vartype default_isolation_id: str - :ivar mac_address: MAC address information of NIC. - :vartype mac_address: str - :ivar slot: The slot attached to the NIC. - :vartype slot: str - :ivar switch_name: The switch attached to the NIC, if any. - :vartype switch_name: str - :ivar nic_type: The type of NIC, physical, virtual, management. - :vartype nic_type: str - :ivar vlan_id: The VLAN ID of the physical NIC. - :vartype vlan_id: str - :ivar nic_status: The status of NIC, up, disconnected. - :vartype nic_status: str - :ivar rdma_capability: Describes the RDMA capability of the network adapter. Known values are: - "Enabled" and "Disabled". - :vartype rdma_capability: str or ~azure.mgmt.azurestackhci.models.RdmaCapability - """ - - adapter_name: Optional[str] = rest_field(name="adapterName", visibility=["read"]) - """Adapter Name of NIC.""" - interface_description: Optional[str] = rest_field(name="interfaceDescription", visibility=["read"]) - """Interface Description of NIC.""" - component_id: Optional[str] = rest_field(name="componentId", visibility=["read"]) - """Component Id of NIC.""" - driver_version: Optional[str] = rest_field(name="driverVersion", visibility=["read"]) - """Driver Version of NIC.""" - ip4_address: Optional[str] = rest_field(name="ip4Address", visibility=["read"]) - """Subnet Mask of NIC.""" - subnet_mask: Optional[str] = rest_field(name="subnetMask", visibility=["read"]) - """Subnet Mask of NIC.""" - default_gateway: Optional[str] = rest_field(name="defaultGateway", visibility=["read"]) - """Default Gateway of NIC.""" - dns_servers: Optional[list[str]] = rest_field(name="dnsServers", visibility=["read"]) - """DNS Servers for NIC.""" - default_isolation_id: Optional[str] = rest_field(name="defaultIsolationId", visibility=["read"]) - """Default Isolation of Management NIC.""" - mac_address: Optional[str] = rest_field(name="macAddress", visibility=["read"]) - """MAC address information of NIC.""" - slot: Optional[str] = rest_field(visibility=["read"]) - """The slot attached to the NIC.""" - switch_name: Optional[str] = rest_field(name="switchName", visibility=["read"]) - """The switch attached to the NIC, if any.""" - nic_type: Optional[str] = rest_field(name="nicType", visibility=["read"]) - """The type of NIC, physical, virtual, management.""" - vlan_id: Optional[str] = rest_field(name="vlanId", visibility=["read"]) - """The VLAN ID of the physical NIC.""" - nic_status: Optional[str] = rest_field(name="nicStatus", visibility=["read"]) - """The status of NIC, up, disconnected.""" - rdma_capability: Optional[Union[str, "_models.RdmaCapability"]] = rest_field( - name="rdmaCapability", visibility=["read"] - ) - """Describes the RDMA capability of the network adapter. Known values are: \"Enabled\" and - \"Disabled\".""" - - -class EdgeMachinePatch(_Model): - """Model for patching edge machine. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.azurestackhci.models.ManagedServiceIdentity - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The managed service identities assigned to this resource.""" - - @overload - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EdgeMachineProperties(_Model): - """Properties for edge machine. - - :ivar edge_machine_kind: Edge Machine type. Known values are: "Standard" and "Dedicated". - :vartype edge_machine_kind: str or ~azure.mgmt.azurestackhci.models.EdgeMachineKind - :ivar provisioning_state: The provisioning state of a resource. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar cloud_id: Unique, immutable resource id. - :vartype cloud_id: str - :ivar arc_machine_resource_group_id: Optional property to create arc machine in custom resource - group. - :vartype arc_machine_resource_group_id: str - :ivar arc_machine_resource_id: Arc machine instance resource id. - :vartype arc_machine_resource_id: str - :ivar arc_gateway_resource_id: Link to Arc Gateway ARM resource Id. - :vartype arc_gateway_resource_id: str - :ivar site_details: Service fetches common configuration from site. - :vartype site_details: ~azure.mgmt.azurestackhci.models.SiteDetails - :ivar ownership_voucher_details: Ownership voucher details for provisioned machine. - :vartype ownership_voucher_details: ~azure.mgmt.azurestackhci.models.OwnershipVoucherDetails - :ivar provisioning_details: Details for device provisioning. - :vartype provisioning_details: ~azure.mgmt.azurestackhci.models.ProvisioningDetails - :ivar device_pool_resource_id: A machine can only be assigned to single device pool. - :vartype device_pool_resource_id: str - :ivar machine_state: OS configuration status details. Known values are: "Created", - "Registering", "Unpurposed", "Transitioning", "Purposed", "Updating", "Resetting", "Failed", - and "Preparing". - :vartype machine_state: str or ~azure.mgmt.azurestackhci.models.EdgeMachineState - :ivar connectivity_status: machine connectivity status. Known values are: "NotSpecified", - "Disconnected", and "Connected". - :vartype connectivity_status: str or - ~azure.mgmt.azurestackhci.models.EdgeMachineConnectivityStatus - :ivar claimed_by: Tracks the ID of the consuming resource, setting the machine as in-use. - :vartype claimed_by: str - :ivar reported_properties: Reported properties for edge machine. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.EdgeMachineReportedProperties - :ivar operation_details: operation status details for edge machine. - :vartype operation_details: list[~azure.mgmt.azurestackhci.models.OperationDetail] - :ivar last_sync_timestamp: Last time data updated to service. - :vartype last_sync_timestamp: ~datetime.datetime - """ - - edge_machine_kind: Optional[Union[str, "_models.EdgeMachineKind"]] = rest_field( - name="edgeMachineKind", visibility=["read", "create"] - ) - """Edge Machine type. Known values are: \"Standard\" and \"Dedicated\".""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provisioning state of a resource. Known values are: \"NotSpecified\", \"Error\", - \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", - \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", - \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and - \"DisableInProgress\".""" - cloud_id: Optional[str] = rest_field(name="cloudId", visibility=["read"]) - """Unique, immutable resource id.""" - arc_machine_resource_group_id: Optional[str] = rest_field( - name="arcMachineResourceGroupId", visibility=["read", "create"] - ) - """Optional property to create arc machine in custom resource group.""" - arc_machine_resource_id: Optional[str] = rest_field( - name="arcMachineResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Arc machine instance resource id.""" - arc_gateway_resource_id: Optional[str] = rest_field(name="arcGatewayResourceId", visibility=["read", "create"]) - """Link to Arc Gateway ARM resource Id.""" - site_details: Optional["_models.SiteDetails"] = rest_field(name="siteDetails", visibility=["read", "create"]) - """Service fetches common configuration from site.""" - ownership_voucher_details: Optional["_models.OwnershipVoucherDetails"] = rest_field( - name="ownershipVoucherDetails", visibility=["read", "create"] - ) - """Ownership voucher details for provisioned machine.""" - provisioning_details: Optional["_models.ProvisioningDetails"] = rest_field( - name="provisioningDetails", visibility=["read", "create"] - ) - """Details for device provisioning.""" - device_pool_resource_id: Optional[str] = rest_field(name="devicePoolResourceId", visibility=["read"]) - """A machine can only be assigned to single device pool.""" - machine_state: Optional[Union[str, "_models.EdgeMachineState"]] = rest_field( - name="machineState", visibility=["read"] - ) - """OS configuration status details. Known values are: \"Created\", \"Registering\", - \"Unpurposed\", \"Transitioning\", \"Purposed\", \"Updating\", \"Resetting\", \"Failed\", and - \"Preparing\".""" - connectivity_status: Optional[Union[str, "_models.EdgeMachineConnectivityStatus"]] = rest_field( - name="connectivityStatus", visibility=["read"] - ) - """machine connectivity status. Known values are: \"NotSpecified\", \"Disconnected\", and - \"Connected\".""" - claimed_by: Optional[str] = rest_field(name="claimedBy", visibility=["read"]) - """Tracks the ID of the consuming resource, setting the machine as in-use.""" - reported_properties: Optional["_models.EdgeMachineReportedProperties"] = rest_field( - name="reportedProperties", visibility=["read"] - ) - """Reported properties for edge machine.""" - operation_details: Optional[list["_models.OperationDetail"]] = rest_field( - name="operationDetails", visibility=["read"] - ) - """operation status details for edge machine.""" - last_sync_timestamp: Optional[datetime.datetime] = rest_field( - name="lastSyncTimestamp", visibility=["read"], format="rfc3339" - ) - """Last time data updated to service.""" - - @overload - def __init__( - self, - *, - edge_machine_kind: Optional[Union[str, "_models.EdgeMachineKind"]] = None, - arc_machine_resource_group_id: Optional[str] = None, - arc_machine_resource_id: Optional[str] = None, - arc_gateway_resource_id: Optional[str] = None, - site_details: Optional["_models.SiteDetails"] = None, - ownership_voucher_details: Optional["_models.OwnershipVoucherDetails"] = None, - provisioning_details: Optional["_models.ProvisioningDetails"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class EdgeMachineRemoteSupportJobProperties(EdgeMachineJobProperties, discriminator="RemoteSupport"): - """Properties for adding a server in the cluster. - - :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and - "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar job_id: Unique, immutable job id. - :vartype job_id: str - :ivar start_time_utc: The UTC date and time at which the job started. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: The UTC date and time at which the job completed. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Edge device job. Known values are: "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and - "Scheduled". - :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar error: error details. - :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail - :ivar job_type: Job Type to support polymorphic resource. Required. Job to provide remote - support to the device. - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.REMOTE_SUPPORT - :ivar access_level: Remote support access level. Required. Known values are: "None", - "Diagnostics", and "DiagnosticsAndRepair". - :vartype access_level: str or ~azure.mgmt.azurestackhci.models.RemoteSupportAccessLevel - :ivar expiration_timestamp: Remote support expiration timestamp. Required. - :vartype expiration_timestamp: ~datetime.datetime - :ivar type: Remote support type. Required. Known values are: "Enable" and "Revoke". - :vartype type: str or ~azure.mgmt.azurestackhci.models.RemoteSupportType - :ivar reported_properties: log collection job reported properties. - :vartype reported_properties: - ~azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportJobReportedProperties - """ - - job_type: Literal[EdgeMachineJobType.REMOTE_SUPPORT] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Job Type to support polymorphic resource. Required. Job to provide remote support to the - device.""" - access_level: Union[str, "_models.RemoteSupportAccessLevel"] = rest_field( - name="accessLevel", visibility=["read", "create", "update", "delete", "query"] - ) - """Remote support access level. Required. Known values are: \"None\", \"Diagnostics\", and - \"DiagnosticsAndRepair\".""" - expiration_timestamp: datetime.datetime = rest_field( - name="expirationTimestamp", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Remote support expiration timestamp. Required.""" - type: Union[str, "_models.RemoteSupportType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Remote support type. Required. Known values are: \"Enable\" and \"Revoke\".""" - reported_properties: Optional["_models.EdgeMachineRemoteSupportJobReportedProperties"] = rest_field( - name="reportedProperties", visibility=["read"] - ) - """log collection job reported properties.""" + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. Required. "HCI" + :vartype kind: str or ~azure.mgmt.azurestackhci.models.EdgeDeviceKind + """ + + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create"]) + """Metadata used by portal/tooling/etc to render different UX experiences for resources of the + same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource + provider must validate and persist this value. Required. \"HCI\"""" @overload def __init__( self, *, - access_level: Union[str, "_models.RemoteSupportAccessLevel"], - expiration_timestamp: datetime.datetime, - type: Union[str, "_models.RemoteSupportType"], - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + kind: str, ) -> None: ... @overload @@ -3955,105 +2524,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.job_type = EdgeMachineJobType.REMOTE_SUPPORT # type: ignore -class EdgeMachineRemoteSupportJobReportedProperties(_Model): # pylint: disable=name-too-long - """Represents the reported properties of a remote support job. +class EdgeDeviceProperties(_Model): + """Edge Device properties. - :ivar percent_complete: The percentage of the job that is complete. - :vartype percent_complete: int - :ivar validation_status: Validation status of job. - :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - :ivar deployment_status: Deployment status of job. - :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - :ivar node_settings: Optional settings for configuring the node for remote support. - :vartype node_settings: ~azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportNodeSettings - :ivar session_details: Details of the remote support session. - :vartype session_details: list[~azure.mgmt.azurestackhci.models.RemoteSupportSession] + :ivar device_configuration: Device Configuration. + :vartype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration + :ivar provisioning_state: Provisioning state of edgeDevice resource. Known values are: + "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState """ - percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) - """The percentage of the job that is complete.""" - validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) - """Validation status of job.""" - deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) - """Deployment status of job.""" - node_settings: Optional["_models.EdgeMachineRemoteSupportNodeSettings"] = rest_field( - name="nodeSettings", visibility=["read"] + device_configuration: Optional["_models.DeviceConfiguration"] = rest_field( + name="deviceConfiguration", visibility=["read", "create", "update", "delete", "query"] ) - """Optional settings for configuring the node for remote support.""" - session_details: Optional[list["_models.RemoteSupportSession"]] = rest_field( - name="sessionDetails", visibility=["read"] + """Device Configuration.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] ) - """Details of the remote support session.""" - - -class EdgeMachineRemoteSupportNodeSettings(_Model): - """Represents the settings of a remote support node. - - :ivar state: The state of the remote support node. - :vartype state: str - :ivar created_at: The timestamp when the node settings were created, in UTC. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The timestamp when the node settings were last updated, in UTC. - :vartype updated_at: ~datetime.datetime - :ivar connection_status: The current connection status of the remote support session. - :vartype connection_status: str - :ivar connection_error_message: The error message, if any, from the last connection attempt. - :vartype connection_error_message: str - """ - - state: Optional[str] = rest_field(visibility=["read"]) - """The state of the remote support node.""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", visibility=["read"], format="rfc3339") - """The timestamp when the node settings were created, in UTC.""" - updated_at: Optional[datetime.datetime] = rest_field(name="updatedAt", visibility=["read"], format="rfc3339") - """The timestamp when the node settings were last updated, in UTC.""" - connection_status: Optional[str] = rest_field(name="connectionStatus", visibility=["read"]) - """The current connection status of the remote support session.""" - connection_error_message: Optional[str] = rest_field(name="connectionErrorMessage", visibility=["read"]) - """The error message, if any, from the last connection attempt.""" - + """Provisioning state of edgeDevice resource. Known values are: \"NotSpecified\", \"Error\", + \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", + \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", + \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and + \"DisableInProgress\".""" -class EdgeMachineReportedProperties(_Model): - """Reported properties for edge machine. + @overload + def __init__( + self, + *, + device_configuration: Optional["_models.DeviceConfiguration"] = None, + ) -> None: ... - :ivar last_updated: Last time data reported. - :vartype last_updated: ~datetime.datetime - :ivar network_profile: Network details for edge machine. - :vartype network_profile: ~azure.mgmt.azurestackhci.models.EdgeMachineNetworkProfile - :ivar os_profile: OS Properties for edge machine. - :vartype os_profile: ~azure.mgmt.azurestackhci.models.OsProfile - :ivar hardware_profile: Hardware related information for edge machine. - :vartype hardware_profile: ~azure.mgmt.azurestackhci.models.HardwareProfile - :ivar storage_profile: Storage related information for edge machine. - :vartype storage_profile: ~azure.mgmt.azurestackhci.models.StorageProfile - :ivar sbe_deployment_package_info: Solution builder extension (SBE) deployment package - information. - :vartype sbe_deployment_package_info: ~azure.mgmt.azurestackhci.models.SbeDeploymentPackageInfo - :ivar extension_profile: Extension details for edge machine. - :vartype extension_profile: ~azure.mgmt.azurestackhci.models.ExtensionProfile - """ + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ - last_updated: Optional[datetime.datetime] = rest_field(name="lastUpdated", visibility=["read"], format="rfc3339") - """Last time data reported.""" - network_profile: Optional["_models.EdgeMachineNetworkProfile"] = rest_field( - name="networkProfile", visibility=["read"] - ) - """Network details for edge machine.""" - os_profile: Optional["_models.OsProfile"] = rest_field(name="osProfile", visibility=["read"]) - """OS Properties for edge machine.""" - hardware_profile: Optional["_models.HardwareProfile"] = rest_field(name="hardwareProfile", visibility=["read"]) - """Hardware related information for edge machine.""" - storage_profile: Optional["_models.StorageProfile"] = rest_field(name="storageProfile", visibility=["read"]) - """Storage related information for edge machine.""" - sbe_deployment_package_info: Optional["_models.SbeDeploymentPackageInfo"] = rest_field( - name="sbeDeploymentPackageInfo", visibility=["read"] - ) - """Solution builder extension (SBE) deployment package information.""" - extension_profile: Optional["_models.ExtensionProfile"] = rest_field(name="extensionProfile", visibility=["read"]) - """Extension details for edge machine.""" + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) class ErrorAdditionalInfo(_Model): @@ -4634,41 +3147,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HardwareProfile(_Model): - """Hardware profile for the machine. - - :ivar cpu_cores: Number of cpu cores in the machine. - :vartype cpu_cores: int - :ivar cpu_sockets: Number of cpu sockets in the machine. - :vartype cpu_sockets: int - :ivar memory_capacity_in_gb: Memory capacity of the machine. - :vartype memory_capacity_in_gb: int - :ivar model: Model info of the machine. - :vartype model: str - :ivar manufacturer: manufacturer info of the machine. - :vartype manufacturer: str - :ivar serial_number: Serial number of the machine. - :vartype serial_number: str - :ivar processor_type: Process type of the machine. - :vartype processor_type: str - """ - - cpu_cores: Optional[int] = rest_field(name="cpuCores", visibility=["read"]) - """Number of cpu cores in the machine.""" - cpu_sockets: Optional[int] = rest_field(name="cpuSockets", visibility=["read"]) - """Number of cpu sockets in the machine.""" - memory_capacity_in_gb: Optional[int] = rest_field(name="memoryCapacityInGb", visibility=["read"]) - """Memory capacity of the machine.""" - model: Optional[str] = rest_field(visibility=["read"]) - """Model info of the machine.""" - manufacturer: Optional[str] = rest_field(visibility=["read"]) - """manufacturer info of the machine.""" - serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) - """Serial number of the machine.""" - processor_type: Optional[str] = rest_field(name="processorType", visibility=["read"]) - """Process type of the machine.""" - - class HciEdgeDeviceJobProperties(_Model): """HCI Edge device job properties. @@ -4705,164 +3183,31 @@ class HciEdgeDeviceJobProperties(_Model): ) """Deployment mode to trigger job. Known values are: \"Validate\" and \"Deploy\".""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Job provisioning state. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", - \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", - \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", - \"InProgress\", \"Accepted\", \"Provisioning\", and \"DisableInProgress\".""" - job_id: Optional[str] = rest_field(name="jobId", visibility=["read"]) - """Unique, immutable job id.""" - start_time_utc: Optional[datetime.datetime] = rest_field(name="startTimeUtc", visibility=["read"], format="rfc3339") - """The UTC date and time at which the job started.""" - end_time_utc: Optional[datetime.datetime] = rest_field(name="endTimeUtc", visibility=["read"], format="rfc3339") - """The UTC date and time at which the job completed.""" - status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"]) - """Status of Edge device job. Known values are: \"NotSpecified\", \"ValidationInProgress\", - \"ValidationSuccess\", \"ValidationFailed\", \"DeploymentInProgress\", \"DeploymentFailed\", - \"DeploymentSuccess\", \"Succeeded\", \"Failed\", \"Canceled\", \"Paused\", and \"Scheduled\".""" - job_type: str = rest_discriminator(name="jobType", visibility=["read", "create"]) - """Job Type to support polymorphic resource. Required. Known values are: \"CollectLog\" and - \"RemoteSupport\".""" - - @overload - def __init__( - self, - *, - job_type: str, - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class HciCollectLogJobProperties(HciEdgeDeviceJobProperties, discriminator="CollectLog"): - """Represents the properties of an HCI Collect Log job. - - :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and - "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar job_id: Unique, immutable job id. - :vartype job_id: str - :ivar start_time_utc: The UTC date and time at which the job started. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: The UTC date and time at which the job completed. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Edge device job. Known values are: "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and - "Scheduled". - :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar from_date: From date for log collection. Required. - :vartype from_date: ~datetime.datetime - :ivar to_date: To date for log collection. Required. - :vartype to_date: ~datetime.datetime - :ivar last_log_generated: To date for log collection. - :vartype last_log_generated: ~datetime.datetime - :ivar reported_properties: log collection job reported properties. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.LogCollectionReportedProperties - :ivar job_type: Job Type to support polymorphic resource. Required. Job to collect logs from - the device. - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.COLLECT_LOG - """ - - from_date: datetime.datetime = rest_field( - name="fromDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """From date for log collection. Required.""" - to_date: datetime.datetime = rest_field( - name="toDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """To date for log collection. Required.""" - last_log_generated: Optional[datetime.datetime] = rest_field( - name="lastLogGenerated", visibility=["read"], format="rfc3339" - ) - """To date for log collection.""" - reported_properties: Optional["_models.LogCollectionReportedProperties"] = rest_field( - name="reportedProperties", visibility=["read"] - ) - """log collection job reported properties.""" - job_type: Literal[HciEdgeDeviceJobType.COLLECT_LOG] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Job Type to support polymorphic resource. Required. Job to collect logs from the device.""" - - @overload - def __init__( - self, - *, - from_date: datetime.datetime, - to_date: datetime.datetime, - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = HciEdgeDeviceJobType.COLLECT_LOG # type: ignore - - -class HciConfigureCvmJobProperties(ClusterJobProperties, discriminator="ConfigureCVM"): - """Defines the customer's intent for updating confidential VM properties. - - :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and - "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar job_id: Unique, immutable job id. - :vartype job_id: str - :ivar start_time_utc: The UTC date and time at which the job started. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: The UTC date and time at which the job completed. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Cluster job. Known values are: "NotSpecified", "ValidationInProgress", - "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", "DeploymentFailed", - "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and "Scheduled". - :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar reported_properties: Reported properties for job. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.JobReportedProperties - :ivar job_type: ClusterJob Type to support polymorphic resource. Required. Job to CVM intent - for the cluster. - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.CONFIGURE_CVM - :ivar confidential_vm_intent: Defines the customer's intent for updating confidential VM - properties. Required. Known values are: "Enable" and "Disable". - :vartype confidential_vm_intent: str or ~azure.mgmt.azurestackhci.models.ConfidentialVmIntent - """ - - job_type: Literal[HciJobType.CONFIGURE_CVM] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """ClusterJob Type to support polymorphic resource. Required. Job to CVM intent for the cluster.""" - confidential_vm_intent: Union[str, "_models.ConfidentialVmIntent"] = rest_field( - name="confidentialVmIntent", visibility=["read", "create", "update", "delete", "query"] + name="provisioningState", visibility=["read"] ) - """Defines the customer's intent for updating confidential VM properties. Required. Known values - are: \"Enable\" and \"Disable\".""" + """Job provisioning state. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", + \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", + \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", + \"InProgress\", \"Accepted\", \"Provisioning\", and \"DisableInProgress\".""" + job_id: Optional[str] = rest_field(name="jobId", visibility=["read"]) + """Unique, immutable job id.""" + start_time_utc: Optional[datetime.datetime] = rest_field(name="startTimeUtc", visibility=["read"], format="rfc3339") + """The UTC date and time at which the job started.""" + end_time_utc: Optional[datetime.datetime] = rest_field(name="endTimeUtc", visibility=["read"], format="rfc3339") + """The UTC date and time at which the job completed.""" + status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"]) + """Status of Edge device job. Known values are: \"NotSpecified\", \"ValidationInProgress\", + \"ValidationSuccess\", \"ValidationFailed\", \"DeploymentInProgress\", \"DeploymentFailed\", + \"DeploymentSuccess\", \"Succeeded\", \"Failed\", \"Canceled\", \"Paused\", and \"Scheduled\".""" + job_type: str = rest_discriminator(name="jobType", visibility=["read", "create"]) + """Job Type to support polymorphic resource. Required. Known values are: \"CollectLog\" and + \"RemoteSupport\".""" @overload def __init__( self, *, - confidential_vm_intent: Union[str, "_models.ConfidentialVmIntent"], + job_type: str, deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, ) -> None: ... @@ -4875,11 +3220,10 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.job_type = HciJobType.CONFIGURE_CVM # type: ignore -class HciConfigureSdnIntegrationJobProperties(ClusterJobProperties, discriminator="ConfigureSdnIntegration"): - """Properties for configuring SDN integration intent for the cluster. +class HciCollectLogJobProperties(HciEdgeDeviceJobProperties, discriminator="CollectLog"): + """Represents the properties of an HCI Collect Log job. :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and "Deploy". @@ -4895,44 +3239,50 @@ class HciConfigureSdnIntegrationJobProperties(ClusterJobProperties, discriminato :vartype start_time_utc: ~datetime.datetime :ivar end_time_utc: The UTC date and time at which the job completed. :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Cluster job. Known values are: "NotSpecified", "ValidationInProgress", - "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", "DeploymentFailed", - "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and "Scheduled". + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar reported_properties: Reported properties for job. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.JobReportedProperties - :ivar job_type: ClusterJob Type to support polymorphic resource. Required. Job to configure SDN - (Software Defined Networking) integration for the cluster. - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.CONFIGURE_SDN_INTEGRATION - :ivar sdn_integration_intent: Defines the customer's intent for configuring SDN integration. - Required. Known values are: "Enable" and "Disable". - :vartype sdn_integration_intent: str or ~azure.mgmt.azurestackhci.models.SdnIntegrationIntent - :ivar sdn_prefix: A string identifier used to construct the Network Controller (NC) REST - resource name. This prefix helps group and distinguish SDN-managed network components and must - follow specific formatting rules. - :vartype sdn_prefix: str - """ - - job_type: Literal[HciJobType.CONFIGURE_SDN_INTEGRATION] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """ClusterJob Type to support polymorphic resource. Required. Job to configure SDN (Software - Defined Networking) integration for the cluster.""" - sdn_integration_intent: Union[str, "_models.SdnIntegrationIntent"] = rest_field( - name="sdnIntegrationIntent", visibility=["read", "create", "update", "delete", "query"] - ) - """Defines the customer's intent for configuring SDN integration. Required. Known values are: - \"Enable\" and \"Disable\".""" - sdn_prefix: Optional[str] = rest_field(name="sdnPrefix", visibility=["read", "create", "update", "delete", "query"]) - """A string identifier used to construct the Network Controller (NC) REST resource name. This - prefix helps group and distinguish SDN-managed network components and must follow specific - formatting rules.""" + :ivar from_date: From date for log collection. Required. + :vartype from_date: ~datetime.datetime + :ivar to_date: To date for log collection. Required. + :vartype to_date: ~datetime.datetime + :ivar last_log_generated: To date for log collection. + :vartype last_log_generated: ~datetime.datetime + :ivar reported_properties: log collection job reported properties. + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.LogCollectionReportedProperties + :ivar job_type: Job Type to support polymorphic resource. Required. Job to collect logs from + the device. + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.COLLECT_LOG + """ + + from_date: datetime.datetime = rest_field( + name="fromDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """From date for log collection. Required.""" + to_date: datetime.datetime = rest_field( + name="toDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """To date for log collection. Required.""" + last_log_generated: Optional[datetime.datetime] = rest_field( + name="lastLogGenerated", visibility=["read"], format="rfc3339" + ) + """To date for log collection.""" + reported_properties: Optional["_models.LogCollectionReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """log collection job reported properties.""" + job_type: Literal[HciEdgeDeviceJobType.COLLECT_LOG] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Job Type to support polymorphic resource. Required. Job to collect logs from the device.""" @overload def __init__( self, *, - sdn_integration_intent: Union[str, "_models.SdnIntegrationIntent"], + from_date: datetime.datetime, + to_date: datetime.datetime, deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, - sdn_prefix: Optional[str] = None, ) -> None: ... @overload @@ -4944,7 +3294,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.job_type = HciJobType.CONFIGURE_SDN_INTEGRATION # type: ignore + self.job_type = HciEdgeDeviceJobType.COLLECT_LOG # type: ignore class HciEdgeDevice(EdgeDevice, discriminator="HCI"): @@ -5359,8 +3709,6 @@ class HciNetworkProfile(_Model): :vartype switch_details: list[~azure.mgmt.azurestackhci.models.SwitchDetail] :ivar host_network: HostNetwork config to deploy AzureStackHCI Cluster. :vartype host_network: ~azure.mgmt.azurestackhci.models.HciEdgeDeviceHostNetwork - :ivar sdn_properties: oftware Defined Networking Properties of the cluster. - :vartype sdn_properties: ~azure.mgmt.azurestackhci.models.SdnProperties """ nic_details: Optional[list["_models.HciNicDetail"]] = rest_field(name="nicDetails", visibility=["read"]) @@ -5369,8 +3717,6 @@ class HciNetworkProfile(_Model): """List of switch details for edge device.""" host_network: Optional["_models.HciEdgeDeviceHostNetwork"] = rest_field(name="hostNetwork", visibility=["read"]) """HostNetwork config to deploy AzureStackHCI Cluster.""" - sdn_properties: Optional["_models.SdnProperties"] = rest_field(name="sdnProperties", visibility=["read"]) - """oftware Defined Networking Properties of the cluster.""" class HciNicDetail(_Model): @@ -5553,8 +3899,6 @@ class ReportedProperties(_Model): :vartype extension_profile: ~azure.mgmt.azurestackhci.models.ExtensionProfile :ivar last_sync_timestamp: Most recent edge device sync timestamp in UTC. :vartype last_sync_timestamp: ~datetime.datetime - :ivar confidential_vm_profile: CVM support details for edge device. - :vartype confidential_vm_profile: ~azure.mgmt.azurestackhci.models.ConfidentialVmProfile """ device_state: Optional[Union[str, "_models.DeviceState"]] = rest_field(name="deviceState", visibility=["read"]) @@ -5566,10 +3910,6 @@ class ReportedProperties(_Model): name="lastSyncTimestamp", visibility=["read"], format="rfc3339" ) """Most recent edge device sync timestamp in UTC.""" - confidential_vm_profile: Optional["_models.ConfidentialVmProfile"] = rest_field( - name="confidentialVmProfile", visibility=["read"] - ) - """CVM support details for edge device.""" class HciReportedProperties(ReportedProperties): @@ -5582,8 +3922,6 @@ class HciReportedProperties(ReportedProperties): :vartype extension_profile: ~azure.mgmt.azurestackhci.models.ExtensionProfile :ivar last_sync_timestamp: Most recent edge device sync timestamp in UTC. :vartype last_sync_timestamp: ~datetime.datetime - :ivar confidential_vm_profile: CVM support details for edge device. - :vartype confidential_vm_profile: ~azure.mgmt.azurestackhci.models.ConfidentialVmProfile :ivar network_profile: HCI device network information. :vartype network_profile: ~azure.mgmt.azurestackhci.models.HciNetworkProfile :ivar os_profile: HCI device OS specific information. @@ -5637,24 +3975,6 @@ class HciValidationFailureDetail(_Model): """Exception details while installing extension.""" -class IgvmStatusDetail(_Model): - """Provides component-level status information related to IGVM enablement on the device. - - :ivar code: A machine-readable status code indicating the result or condition of a specific - IGVM-related check or operation. - :vartype code: str - :ivar message: A human-readable message providing context or explanation for the associated - status code. - :vartype message: str - """ - - code: Optional[str] = rest_field(visibility=["read"]) - """A machine-readable status code indicating the result or condition of a specific IGVM-related - check or operation.""" - message: Optional[str] = rest_field(visibility=["read"]) - """A human-readable message providing context or explanation for the associated status code.""" - - class InfrastructureNetwork(_Model): """The InfrastructureNetwork of a AzureStackHCI Cluster. @@ -5730,39 +4050,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IpAddressRange(_Model): - """IP address range configuration. - - :ivar start_ip: Start IP address. Required. - :vartype start_ip: str - :ivar end_ip: End IP address. Required. - :vartype end_ip: str - """ - - start_ip: str = rest_field(name="startIp", visibility=["read", "create", "update", "delete", "query"]) - """Start IP address. Required.""" - end_ip: str = rest_field(name="endIp", visibility=["read", "create", "update", "delete", "query"]) - """End IP address. Required.""" - - @overload - def __init__( - self, - *, - start_ip: str, - end_ip: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class IpPools(_Model): """The dnsServers of a device. @@ -5828,94 +4115,6 @@ class IsolatedVmAttestationConfiguration(_Model): """Region specific endpoint for Microsoft Azure Attestation service for the cluster.""" -class JobReportedProperties(_Model): - """Reported Properties for job triggered from cloud. - - :ivar percent_complete: The percentage of the job that is complete. - :vartype percent_complete: int - :ivar validation_status: Validation status of job. - :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - :ivar deployment_status: Deployment status of job. - :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - """ - - percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) - """The percentage of the job that is complete.""" - validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) - """Validation status of job.""" - deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) - """Deployment status of job.""" - - -class KubernetesVersion(ProxyResource): - """Represents a kubernetes version resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.azurestackhci.models.KubernetesVersionProperties - """ - - properties: Optional["_models.KubernetesVersionProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.KubernetesVersionProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class KubernetesVersionProperties(_Model): - """Represents properties of a kubernetes version. - - :ivar version: Represents kubernetes version. Required. - :vartype version: str - """ - - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Represents kubernetes version. Required.""" - - @overload - def __init__( - self, - *, - version: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class LocalAvailabilityZones(_Model): """Local Availability Zone information for HCI cluster. @@ -6186,150 +4385,39 @@ class ManagedServiceIdentity(_Model): :ivar principal_id: The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.azurestackhci.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The identities assigned to this resource by the user. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.azurestackhci.models.UserAssignedIdentity] - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The service principal ID of the system assigned identity. This property will only be provided - for a system assigned identity.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) - """The tenant ID of the system assigned identity. This property will only be provided for a system - assigned identity.""" - type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of managed identity assigned to this resource. Required. Known values are: \"None\", - \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( - name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] - ) - """The identities assigned to this resource by the user.""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NetworkAdapter(_Model): - """Network adapter configuration. - - :ivar ip_assignment_type: Type of IP assignment. Required. Known values are: "Automatic" and - "Manual". - :vartype ip_assignment_type: str or ~azure.mgmt.azurestackhci.models.IpAssignmentType - :ivar ip_address: IP address. - :vartype ip_address: str - :ivar adapter_name: Adapter Name. - :vartype adapter_name: str - :ivar mac_address: MAC address. - :vartype mac_address: str - :ivar ip_address_range: IP address range. - :vartype ip_address_range: ~azure.mgmt.azurestackhci.models.IpAddressRange - :ivar gateway: Gateway id. - :vartype gateway: str - :ivar subnet_mask: Subnet mask. - :vartype subnet_mask: str - :ivar dns_address_array: Array of DNS addresses. - :vartype dns_address_array: list[str] - :ivar vlan_id: VLAN ID for the network setup. - :vartype vlan_id: str - """ - - ip_assignment_type: Union[str, "_models.IpAssignmentType"] = rest_field( - name="ipAssignmentType", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of IP assignment. Required. Known values are: \"Automatic\" and \"Manual\".""" - ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read", "create", "update", "delete", "query"]) - """IP address.""" - adapter_name: Optional[str] = rest_field( - name="adapterName", visibility=["read", "create", "update", "delete", "query"] - ) - """Adapter Name.""" - mac_address: Optional[str] = rest_field( - name="macAddress", visibility=["read", "create", "update", "delete", "query"] - ) - """MAC address.""" - ip_address_range: Optional["_models.IpAddressRange"] = rest_field( - name="ipAddressRange", visibility=["read", "create", "update", "delete", "query"] - ) - """IP address range.""" - gateway: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gateway id.""" - subnet_mask: Optional[str] = rest_field( - name="subnetMask", visibility=["read", "create", "update", "delete", "query"] - ) - """Subnet mask.""" - dns_address_array: Optional[list[str]] = rest_field( - name="dnsAddressArray", visibility=["read", "create", "update", "delete", "query"] - ) - """Array of DNS addresses.""" - vlan_id: Optional[str] = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) - """VLAN ID for the network setup.""" - - @overload - def __init__( - self, - *, - ip_assignment_type: Union[str, "_models.IpAssignmentType"], - ip_address: Optional[str] = None, - adapter_name: Optional[str] = None, - mac_address: Optional[str] = None, - ip_address_range: Optional["_models.IpAddressRange"] = None, - gateway: Optional[str] = None, - subnet_mask: Optional[str] = None, - dns_address_array: Optional[list[str]] = None, - vlan_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class NetworkConfiguration(_Model): - """Network configuration. - - :ivar network_adapters: List of network adapters. - :vartype network_adapters: list[~azure.mgmt.azurestackhci.models.NetworkAdapter] + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.azurestackhci.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.azurestackhci.models.UserAssignedIdentity] """ - network_adapters: Optional[list["_models.NetworkAdapter"]] = rest_field( - name="networkAdapters", visibility=["read", "create", "update", "delete", "query"] + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] ) - """List of network adapters.""" + """The identities assigned to this resource by the user.""" @overload def __init__( self, *, - network_adapters: Optional[list["_models.NetworkAdapter"]] = None, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, ) -> None: ... @overload @@ -6654,321 +4742,22 @@ class OfferProperties(_Model): content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """JSON serialized catalog content of the offer.""" content_version: Optional[str] = rest_field( - name="contentVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """The API version of the catalog service used to serve the catalog content.""" - sku_mappings: Optional[list["_models.SkuMappings"]] = rest_field( - name="skuMappings", visibility=["read", "create", "update", "delete", "query"] - ) - """Array of SKU mappings.""" - - @overload - def __init__( - self, - *, - publisher_id: Optional[str] = None, - content: Optional[str] = None, - content_version: Optional[str] = None, - sku_mappings: Optional[list["_models.SkuMappings"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OnboardingConfiguration(_Model): - """Onboarding configuration. - - :ivar type: Type of the onboarding resource to support polymorphic resource. - "HybridComputeMachine" - :vartype type: str or ~azure.mgmt.azurestackhci.models.OnboardingResourceType - :ivar resource_id: Resource ID. - :vartype resource_id: str - :ivar location: Location of the resource. - :vartype location: str - :ivar tenant_id: Tenant ID of the resource. - :vartype tenant_id: str - :ivar arc_virtual_machine_id: Azure Arc virtual machine ID. - :vartype arc_virtual_machine_id: str - """ - - type: Optional[Union[str, "_models.OnboardingResourceType"]] = rest_field(visibility=["read", "create"]) - """Type of the onboarding resource to support polymorphic resource. \"HybridComputeMachine\"""" - resource_id: Optional[str] = rest_field( - name="resourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Resource ID.""" - location: Optional[str] = rest_field(visibility=["read", "create"]) - """Location of the resource.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """Tenant ID of the resource.""" - arc_virtual_machine_id: Optional[str] = rest_field( - name="arcVirtualMachineId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure Arc virtual machine ID.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.OnboardingResourceType"]] = None, - resource_id: Optional[str] = None, - location: Optional[str] = None, - tenant_id: Optional[str] = None, - arc_virtual_machine_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Operation(_Model): - """REST API Operation. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for Azure Resource Manager/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.azurestackhci.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.azurestackhci.models.Origin - :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions - that are for internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.azurestackhci.models.ActionType - """ - - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - \"Microsoft.Compute/virtualMachines/write\", - \"Microsoft.Compute/virtualMachines/capture/action\".""" - is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) - """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and - \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Localized display information for this particular operation.""" - origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and - \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) - """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for - internal only APIs. \"Internal\"""" - - @overload - def __init__( - self, - *, - display: Optional["_models.OperationDisplay"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OperationDetail(_Model): - """operation detail. - - :ivar name: operation name. - :vartype name: str - :ivar id: operation id. - :vartype id: str - :ivar type: operation type. - :vartype type: str - :ivar resource_id: operation resource id. - :vartype resource_id: str - :ivar description: operation description. - :vartype description: str - :ivar status: operation status. - :vartype status: str - :ivar error: error details. - :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail - """ - - name: Optional[str] = rest_field(visibility=["read"]) - """operation name.""" - id: Optional[str] = rest_field(visibility=["read"]) - """operation id.""" - type: Optional[str] = rest_field(visibility=["read"]) - """operation type.""" - resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) - """operation resource id.""" - description: Optional[str] = rest_field(visibility=["read"]) - """operation description.""" - status: Optional[str] = rest_field(visibility=["read"]) - """operation status.""" - error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read"]) - """error details.""" - - -class OperationDisplay(_Model): - """Localized display information for an operation. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - provider: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring - Insights\" or \"Microsoft Compute\".""" - resource: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly name of the resource type related to this operation. E.g. \"Virtual - Machines\" or \"Job Schedule Collections\".""" - operation: Optional[str] = rest_field(visibility=["read"]) - """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create - or Update Virtual Machine\", \"Restart Virtual Machine\".""" - description: Optional[str] = rest_field(visibility=["read"]) - """The short, localized friendly description of the operation; suitable for tool tips and detailed - views.""" - - -class OptionalServices(_Model): - """The OptionalServices of AzureStackHCI Cluster. - - :ivar custom_location: The name of custom location. - :vartype custom_location: str - """ - - custom_location: Optional[str] = rest_field( - name="customLocation", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of custom location.""" - - @overload - def __init__( - self, - *, - custom_location: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OsImage(ProxyResource): - """Represents a os image resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.azurestackhci.models.OsImageProperties - """ - - properties: Optional["_models.OsImageProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.OsImageProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class OsImageProperties(_Model): - """Represents properties of a os image resource. - - :ivar validated_solution_recipe_version: Represents validated solution recipe version of a os - image. - :vartype validated_solution_recipe_version: str - :ivar composed_image_version: Represents composed image version of a os image. - :vartype composed_image_version: str - :ivar composed_image_iso_url: Represents composed image iso download url of a os image. - :vartype composed_image_iso_url: str - :ivar composed_image_iso_hash: Represents composed image iso hash of a os image. - :vartype composed_image_iso_hash: str - """ - - validated_solution_recipe_version: Optional[str] = rest_field( - name="validatedSolutionRecipeVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents validated solution recipe version of a os image.""" - composed_image_version: Optional[str] = rest_field( - name="composedImageVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents composed image version of a os image.""" - composed_image_iso_url: Optional[str] = rest_field( - name="composedImageIsoUrl", visibility=["read", "create", "update", "delete", "query"] + name="contentVersion", visibility=["read", "create", "update", "delete", "query"] ) - """Represents composed image iso download url of a os image.""" - composed_image_iso_hash: Optional[str] = rest_field( - name="composedImageIsoHash", visibility=["read", "create", "update", "delete", "query"] + """The API version of the catalog service used to serve the catalog content.""" + sku_mappings: Optional[list["_models.SkuMappings"]] = rest_field( + name="skuMappings", visibility=["read", "create", "update", "delete", "query"] ) - """Represents composed image iso hash of a os image.""" + """Array of SKU mappings.""" @overload def __init__( self, *, - validated_solution_recipe_version: Optional[str] = None, - composed_image_version: Optional[str] = None, - composed_image_iso_url: Optional[str] = None, - composed_image_iso_hash: Optional[str] = None, + publisher_id: Optional[str] = None, + content: Optional[str] = None, + content_version: Optional[str] = None, + sku_mappings: Optional[list["_models.SkuMappings"]] = None, ) -> None: ... @overload @@ -6982,106 +4771,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OsProfile(_Model): - """OS configurations for HCI device. +class Operation(_Model): + """REST API Operation. - :ivar boot_type: The boot type of the device. e.g. UEFI, Legacy etc. - :vartype boot_type: str - :ivar assembly_version: Version of assembly present on device. - :vartype assembly_version: str - :ivar os_type: OS type (“windows", “linux”). - :vartype os_type: str - :ivar os_sku: OS SKU (e.g., “ Microsoft Azure Linux ROE“, “Azure Stack HCI", "Microsoft Azure - Linux 3.0"). - :vartype os_sku: str - :ivar os_version: OS Version. - :vartype os_version: str - :ivar build_number: OS Build Number. - :vartype build_number: str - :ivar base_image_version: OS Base Image Version. - :vartype base_image_version: str - :ivar image_version: OS Image Version. - :vartype image_version: str + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.azurestackhci.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.azurestackhci.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.azurestackhci.models.ActionType """ - boot_type: Optional[str] = rest_field(name="bootType", visibility=["read"]) - """The boot type of the device. e.g. UEFI, Legacy etc.""" - assembly_version: Optional[str] = rest_field(name="assemblyVersion", visibility=["read"]) - """Version of assembly present on device.""" - os_type: Optional[str] = rest_field(name="osType", visibility=["read"]) - """OS type (“windows\", “linux”).""" - os_sku: Optional[str] = rest_field(name="osSku", visibility=["read"]) - """OS SKU (e.g., “ Microsoft Azure Linux ROE“, “Azure Stack HCI\", \"Microsoft Azure Linux 3.0\").""" - os_version: Optional[str] = rest_field(name="osVersion", visibility=["read"]) - """OS Version.""" - build_number: Optional[str] = rest_field(name="buildNumber", visibility=["read"]) - """OS Build Number.""" - base_image_version: Optional[str] = rest_field(name="baseImageVersion", visibility=["read"]) - """OS Base Image Version.""" - image_version: Optional[str] = rest_field(name="imageVersion", visibility=["read"]) - """OS Image Version.""" - - -class OsProvisionProfile(_Model): - """Operating system profile. - - :ivar os_name: Name of the operating system. - :vartype os_name: str - :ivar os_type: Type of the operating system. - :vartype os_type: str - :ivar os_version: Version of the operating system. - :vartype os_version: str - :ivar os_image_location: Location of the operating system image. - :vartype os_image_location: str - :ivar vsr_version: Validated Solution Recipe version to be used for the job. - :vartype vsr_version: str - :ivar image_hash: Hash of the OS package downloaded. - :vartype image_hash: str - :ivar gpg_pub_key: GPG Public Key used for package verification. - :vartype gpg_pub_key: str - :ivar operation_type: Operation sub type of OS Provisioning. Known values are: "Provision", - "Update", and "ReImage". - :vartype operation_type: str or ~azure.mgmt.azurestackhci.models.OSOperationType - """ - - os_name: Optional[str] = rest_field(name="osName", visibility=["read", "create", "update", "delete", "query"]) - """Name of the operating system.""" - os_type: Optional[str] = rest_field(name="osType", visibility=["read", "create", "update", "delete", "query"]) - """Type of the operating system.""" - os_version: Optional[str] = rest_field(name="osVersion", visibility=["read", "create", "update", "delete", "query"]) - """Version of the operating system.""" - os_image_location: Optional[str] = rest_field( - name="osImageLocation", visibility=["read", "create", "update", "delete", "query"] - ) - """Location of the operating system image.""" - vsr_version: Optional[str] = rest_field( - name="vsrVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Validated Solution Recipe version to be used for the job.""" - image_hash: Optional[str] = rest_field(name="imageHash", visibility=["read", "create", "update", "delete", "query"]) - """Hash of the OS package downloaded.""" - gpg_pub_key: Optional[str] = rest_field( - name="gpgPubKey", visibility=["read", "create", "update", "delete", "query"] - ) - """GPG Public Key used for package verification.""" - operation_type: Optional[Union[str, "_models.OSOperationType"]] = rest_field( - name="operationType", visibility=["read", "create", "update", "delete", "query"] + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Operation sub type of OS Provisioning. Known values are: \"Provision\", \"Update\", and - \"ReImage\".""" + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" @overload def __init__( self, *, - os_name: Optional[str] = None, - os_type: Optional[str] = None, - os_version: Optional[str] = None, - os_image_location: Optional[str] = None, - vsr_version: Optional[str] = None, - image_hash: Optional[str] = None, - gpg_pub_key: Optional[str] = None, - operation_type: Optional[Union[str, "_models.OSOperationType"]] = None, + display: Optional["_models.OperationDisplay"] = None, ) -> None: ... @overload @@ -7095,107 +4828,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OwnershipVoucherDetails(_Model): - """Details for ownership voucher. +class OperationDisplay(_Model): + """Localized display information for an operation. - :ivar ownership_voucher: Ownership voucher in base64 encoded format. Required. - :vartype ownership_voucher: str - :ivar owner_key_type: Owner key type. Required. "MicrosoftManaged" - :vartype owner_key_type: str or ~azure.mgmt.azurestackhci.models.OwnerKeyType - :ivar validation_details: Ownership Voucher Validation Details. - :vartype validation_details: ~azure.mgmt.azurestackhci.models.OwnershipVoucherValidationDetails + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str """ - ownership_voucher: str = rest_field( - name="ownershipVoucher", visibility=["read", "create", "update", "delete", "query"] - ) - """Ownership voucher in base64 encoded format. Required.""" - owner_key_type: Union[str, "_models.OwnerKeyType"] = rest_field( - name="ownerKeyType", visibility=["read", "create", "update", "delete", "query"] - ) - """Owner key type. Required. \"MicrosoftManaged\"""" - validation_details: Optional["_models.OwnershipVoucherValidationDetails"] = rest_field( - name="validationDetails", visibility=["read"] - ) - """Ownership Voucher Validation Details.""" - - @overload - def __init__( - self, - *, - ownership_voucher: str, - owner_key_type: Union[str, "_models.OwnerKeyType"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" -class OwnershipVoucherValidationDetails(_Model): - """Ownership Voucher Validation Details. +class OptionalServices(_Model): + """The OptionalServices of AzureStackHCI Cluster. - :ivar validation_status: The ownership voucher validation status. Known values are: "Valid" and - "Invalid". - :vartype validation_status: str or - ~azure.mgmt.azurestackhci.models.OwnershipVoucherValidationStatus - :ivar serial_number: Serial number of the device. - :vartype serial_number: str - :ivar id: FDO guid of the Ownership Voucher. - :vartype id: str - :ivar manufacturer: Name of the manufacturer. - :vartype manufacturer: str - :ivar model_name: Name of the model. - :vartype model_name: str - :ivar version: Version of the Ownership Voucher format. - :vartype version: str - :ivar azure_machine_id: Azure Machine Id of the Ownership voucher. - :vartype azure_machine_id: str - :ivar error: Error details if the validation failed. - :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + :ivar custom_location: The name of custom location. + :vartype custom_location: str """ - validation_status: Optional[Union[str, "_models.OwnershipVoucherValidationStatus"]] = rest_field( - name="validationStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """The ownership voucher validation status. Known values are: \"Valid\" and \"Invalid\".""" - serial_number: Optional[str] = rest_field( - name="serialNumber", visibility=["read", "create", "update", "delete", "query"] - ) - """Serial number of the device.""" - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """FDO guid of the Ownership Voucher.""" - manufacturer: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the manufacturer.""" - model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) - """Name of the model.""" - version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Version of the Ownership Voucher format.""" - azure_machine_id: Optional[str] = rest_field( - name="azureMachineId", visibility=["read", "create", "update", "delete", "query"] + custom_location: Optional[str] = rest_field( + name="customLocation", visibility=["read", "create", "update", "delete", "query"] ) - """Azure Machine Id of the Ownership voucher.""" - error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error details if the validation failed.""" + """The name of custom location.""" @overload def __init__( self, *, - validation_status: Optional[Union[str, "_models.OwnershipVoucherValidationStatus"]] = None, - serial_number: Optional[str] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - manufacturer: Optional[str] = None, - model_name: Optional[str] = None, - version: Optional[str] = None, - azure_machine_id: Optional[str] = None, - error: Optional["_models.ErrorDetail"] = None, + custom_location: Optional[str] = None, ) -> None: ... @overload @@ -7391,208 +5071,41 @@ class PerNodeState(_Model): arc_instance: Optional[str] = rest_field(name="arcInstance", visibility=["read"]) """Fully qualified resource ID for the Arc agent of this node.""" arc_node_service_principal_object_id: Optional[str] = rest_field( - name="arcNodeServicePrincipalObjectId", visibility=["read"] - ) - """The service principal id of the arc for server node.""" - state: Optional[Union[str, "_models.NodeArcState"]] = rest_field(visibility=["read"]) - """State of the Arc agent in this node. Indicates the current lifecycle status of the agent, such - as whether it's being provisioned, connected, updated, or has encountered an error. Known - values are: \"NotSpecified\", \"Error\", \"Succeeded\", \"Canceled\", \"Failed\", - \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", - \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", \"Accepted\", - \"Provisioning\", and \"DisableInProgress\".""" - - -class PhysicalNodes(_Model): - """The PhysicalNodes of a cluster. - - :ivar name: NETBIOS name of each physical server on your Azure Stack HCI cluster. - :vartype name: str - :ivar ipv4_address: The IPv4 address assigned to each physical server on your Azure Stack HCI - cluster. - :vartype ipv4_address: str - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """NETBIOS name of each physical server on your Azure Stack HCI cluster.""" - ipv4_address: Optional[str] = rest_field( - name="ipv4Address", visibility=["read", "create", "update", "delete", "query"] - ) - """The IPv4 address assigned to each physical server on your Azure Stack HCI cluster.""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - ipv4_address: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PlatformPayload(_Model): - """Represents details of a specific platform update payload. - - :ivar payload_url: Represents url of a platform update payload. - :vartype payload_url: str - :ivar payload_hash: Represents hash of a platform update payload. - :vartype payload_hash: str - :ivar payload_package_size_in_bytes: Represents size in bytes of a platform update payload. - :vartype payload_package_size_in_bytes: str - :ivar payload_identifier: Represents identifier of a platform update payload. - :vartype payload_identifier: str - """ - - payload_url: Optional[str] = rest_field( - name="payloadUrl", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents url of a platform update payload.""" - payload_hash: Optional[str] = rest_field( - name="payloadHash", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents hash of a platform update payload.""" - payload_package_size_in_bytes: Optional[str] = rest_field( - name="payloadPackageSizeInBytes", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents size in bytes of a platform update payload.""" - payload_identifier: Optional[str] = rest_field( - name="payloadIdentifier", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents identifier of a platform update payload.""" - - @overload - def __init__( - self, - *, - payload_url: Optional[str] = None, - payload_hash: Optional[str] = None, - payload_package_size_in_bytes: Optional[str] = None, - payload_identifier: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PlatformUpdate(ProxyResource): - """Represents a platform update resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.azurestackhci.models.PlatformUpdateProperties - """ - - properties: Optional["_models.PlatformUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.PlatformUpdateProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PlatformUpdateDetails(_Model): - """Represents details of a specific platform update. - - :ivar validated_solution_recipe_version: Represents validated solution recipe version of a - platform update. - :vartype validated_solution_recipe_version: str - :ivar platform_version: Represents version of a platform update. - :vartype platform_version: str - :ivar platform_payloads: Represents the platform payloads of a platform update. Required. - :vartype platform_payloads: list[~azure.mgmt.azurestackhci.models.PlatformPayload] - """ - - validated_solution_recipe_version: Optional[str] = rest_field( - name="validatedSolutionRecipeVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents validated solution recipe version of a platform update.""" - platform_version: Optional[str] = rest_field( - name="platformVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents version of a platform update.""" - platform_payloads: list["_models.PlatformPayload"] = rest_field( - name="platformPayloads", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents the platform payloads of a platform update. Required.""" - - @overload - def __init__( - self, - *, - platform_payloads: list["_models.PlatformPayload"], - validated_solution_recipe_version: Optional[str] = None, - platform_version: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) + name="arcNodeServicePrincipalObjectId", visibility=["read"] + ) + """The service principal id of the arc for server node.""" + state: Optional[Union[str, "_models.NodeArcState"]] = rest_field(visibility=["read"]) + """State of the Arc agent in this node. Indicates the current lifecycle status of the agent, such + as whether it's being provisioned, connected, updated, or has encountered an error. Known + values are: \"NotSpecified\", \"Error\", \"Succeeded\", \"Canceled\", \"Failed\", + \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", + \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", \"Accepted\", + \"Provisioning\", and \"DisableInProgress\".""" -class PlatformUpdateProperties(_Model): - """Represents properties of a platform update resource. +class PhysicalNodes(_Model): + """The PhysicalNodes of a cluster. - :ivar platform_update_details: Represents applicable platform updates. Required. - :vartype platform_update_details: list[~azure.mgmt.azurestackhci.models.PlatformUpdateDetails] + :ivar name: NETBIOS name of each physical server on your Azure Stack HCI cluster. + :vartype name: str + :ivar ipv4_address: The IPv4 address assigned to each physical server on your Azure Stack HCI + cluster. + :vartype ipv4_address: str """ - platform_update_details: list["_models.PlatformUpdateDetails"] = rest_field( - name="platformUpdateDetails", visibility=["read", "create", "update", "delete", "query"] + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """NETBIOS name of each physical server on your Azure Stack HCI cluster.""" + ipv4_address: Optional[str] = rest_field( + name="ipv4Address", visibility=["read", "create", "update", "delete", "query"] ) - """Represents applicable platform updates. Required.""" + """The IPv4 address assigned to each physical server on your Azure Stack HCI cluster.""" @overload def __init__( self, *, - platform_update_details: list["_models.PlatformUpdateDetails"], + name: Optional[str] = None, + ipv4_address: Optional[str] = None, ) -> None: ... @overload @@ -7777,265 +5290,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProvisioningDetails(_Model): - """Details for device provisioning. - - :ivar os_profile: Operating system profile. Required. - :vartype os_profile: ~azure.mgmt.azurestackhci.models.OsProvisionProfile - :ivar user_details: User configuration. - :vartype user_details: list[~azure.mgmt.azurestackhci.models.UserDetails] - """ - - os_profile: "_models.OsProvisionProfile" = rest_field( - name="osProfile", visibility=["read", "create", "update", "delete", "query"] - ) - """Operating system profile. Required.""" - user_details: Optional[list["_models.UserDetails"]] = rest_field( - name="userDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """User configuration.""" - - @overload - def __init__( - self, - *, - os_profile: "_models.OsProvisionProfile", - user_details: Optional[list["_models.UserDetails"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ProvisioningRequest(_Model): - """Represents a provisioning request. - - :ivar target: Target operating system to support polymorphic resource. Required. Known values - are: "AzureLinux" and "HCI". - :vartype target: str or ~azure.mgmt.azurestackhci.models.ProvisioningOsType - :ivar os_profile: Operating system profile. Required. - :vartype os_profile: ~azure.mgmt.azurestackhci.models.OsProvisionProfile - :ivar user_details: User configuration. - :vartype user_details: list[~azure.mgmt.azurestackhci.models.UserDetails] - :ivar onboarding_configuration: Onboarding configuration. - :vartype onboarding_configuration: ~azure.mgmt.azurestackhci.models.OnboardingConfiguration - :ivar device_configuration: Device configuration. - :vartype device_configuration: ~azure.mgmt.azurestackhci.models.TargetDeviceConfiguration - :ivar custom_configuration: Base64 encoded custom configuration for CAPI to use. - :vartype custom_configuration: str - """ - - target: Union[str, "_models.ProvisioningOsType"] = rest_field(visibility=["read", "create"]) - """Target operating system to support polymorphic resource. Required. Known values are: - \"AzureLinux\" and \"HCI\".""" - os_profile: "_models.OsProvisionProfile" = rest_field( - name="osProfile", visibility=["read", "create", "update", "delete", "query"] - ) - """Operating system profile. Required.""" - user_details: Optional[list["_models.UserDetails"]] = rest_field( - name="userDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """User configuration.""" - onboarding_configuration: Optional["_models.OnboardingConfiguration"] = rest_field( - name="onboardingConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Onboarding configuration.""" - device_configuration: Optional["_models.TargetDeviceConfiguration"] = rest_field( - name="deviceConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Device configuration.""" - custom_configuration: Optional[str] = rest_field( - name="customConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """Base64 encoded custom configuration for CAPI to use.""" - - @overload - def __init__( - self, - *, - target: Union[str, "_models.ProvisioningOsType"], - os_profile: "_models.OsProvisionProfile", - user_details: Optional[list["_models.UserDetails"]] = None, - onboarding_configuration: Optional["_models.OnboardingConfiguration"] = None, - device_configuration: Optional["_models.TargetDeviceConfiguration"] = None, - custom_configuration: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ProvisionOsJobProperties(EdgeMachineJobProperties, discriminator="ProvisionOs"): - """Represents the properties of an Azure Linux restricted operating environment Provision Os job. - - :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and - "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar job_id: Unique, immutable job id. - :vartype job_id: str - :ivar start_time_utc: The UTC date and time at which the job started. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: The UTC date and time at which the job completed. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of Edge device job. Known values are: "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and - "Scheduled". - :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus - :ivar error: error details. - :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail - :ivar job_type: Job Type to support polymorphic resource. Required. Job to provision operating - system in the device. - :vartype job_type: str or ~azure.mgmt.azurestackhci.models.PROVISION_OS - :ivar provisioning_request: Os Provisioning request. Required. - :vartype provisioning_request: ~azure.mgmt.azurestackhci.models.ProvisioningRequest - :ivar reported_properties: Reported Properties for Provision Os job. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.ProvisionOsReportedProperties - """ - - job_type: Literal[EdgeMachineJobType.PROVISION_OS] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Job Type to support polymorphic resource. Required. Job to provision operating system in the - device.""" - provisioning_request: "_models.ProvisioningRequest" = rest_field( - name="provisioningRequest", visibility=["read", "create", "update", "delete", "query"] - ) - """Os Provisioning request. Required.""" - reported_properties: Optional["_models.ProvisionOsReportedProperties"] = rest_field( - name="reportedProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Reported Properties for Provision Os job.""" - - @overload - def __init__( - self, - *, - provisioning_request: "_models.ProvisioningRequest", - deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, - reported_properties: Optional["_models.ProvisionOsReportedProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.job_type = EdgeMachineJobType.PROVISION_OS # type: ignore - - -class ProvisionOsReportedProperties(_Model): - """Reported Properties for Provision Os job. - - :ivar percent_complete: The percentage of the job that is complete. - :vartype percent_complete: int - :ivar validation_status: Validation status of job. - :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - :ivar deployment_status: Deployment status of job. - :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - """ - - percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) - """The percentage of the job that is complete.""" - validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) - """Validation status of job.""" - deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) - """Deployment status of job.""" - - -class Publisher(ProxyResource): - """Publisher details. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar properties: Publisher properties. - :vartype properties: ~azure.mgmt.azurestackhci.models.PublisherProperties - """ - - properties: Optional["_models.PublisherProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Publisher properties.""" - - __flattened_items = ["provisioning_state"] - - @overload - def __init__( - self, - *, - properties: Optional["_models.PublisherProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class PublisherProperties(_Model): - """Publisher properties. - - :ivar provisioning_state: Provisioning State. - :vartype provisioning_state: str - """ - - provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) - """Provisioning State.""" - - class QosPolicyOverrides(_Model): """The QoSPolicyOverrides of a cluster. @@ -8172,34 +5426,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ReleaseDeviceRequest(_Model): - """Request for releasing devices of the pool. - - :ivar devices: List of resource ids of the devices to be modified. Required. - :vartype devices: list[str] - """ - - devices: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of resource ids of the devices to be modified. Required.""" - - @overload - def __init__( - self, - *, - devices: list[str], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class RemoteSupportJobNodeSettings(_Model): """Represents the settings of a remote support node. @@ -9121,75 +6347,37 @@ def __getattr__(self, name: str) -> Any: def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class ServiceConfiguration(_Model): - """Service configuration details. - - :ivar service_name: Specifies the name of the service associated with the update or operation. - This helps identify which system component or tool is involved. Required. "WAC" - :vartype service_name: str or ~azure.mgmt.azurestackhci.models.ServiceName - :ivar port: The port on which service is enabled. Required. - :vartype port: int - """ - - service_name: Union[str, "_models.ServiceName"] = rest_field( - name="serviceName", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the name of the service associated with the update or operation. This helps identify - which system component or tool is involved. Required. \"WAC\"""" - port: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The port on which service is enabled. Required.""" - - @overload - def __init__( - self, - *, - service_name: Union[str, "_models.ServiceName"], - port: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) -class SiteDetails(_Model): - """Site Details consists of common configurations. +class ServiceConfiguration(_Model): + """Service configuration details. - :ivar site_resource_id: Site resource Id to be set during Edge Machine resource creation. - Required. - :vartype site_resource_id: str - :ivar device_configuration: Edge Device configuration received from site common configuration. - :vartype device_configuration: ~azure.mgmt.azurestackhci.models.TargetDeviceConfiguration + :ivar service_name: Specifies the name of the service associated with the update or operation. + This helps identify which system component or tool is involved. Required. "WAC" + :vartype service_name: str or ~azure.mgmt.azurestackhci.models.ServiceName + :ivar port: The port on which service is enabled. Required. + :vartype port: int """ - site_resource_id: str = rest_field( - name="siteResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Site resource Id to be set during Edge Machine resource creation. Required.""" - device_configuration: Optional["_models.TargetDeviceConfiguration"] = rest_field( - name="deviceConfiguration", visibility=["read", "create", "update", "delete", "query"] + service_name: Union[str, "_models.ServiceName"] = rest_field( + name="serviceName", visibility=["read", "create", "update", "delete", "query"] ) - """Edge Device configuration received from site common configuration.""" + """Specifies the name of the service associated with the update or operation. This helps identify + which system component or tool is involved. Required. \"WAC\"""" + port: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The port on which service is enabled. Required.""" @overload def __init__( self, *, - site_resource_id: str, - device_configuration: Optional["_models.TargetDeviceConfiguration"] = None, + service_name: Union[str, "_models.ServiceName"], + port: int, ) -> None: ... @overload @@ -9615,47 +6803,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StorageConfiguration(_Model): - """Storage configuration. - - :ivar partition_size: Partition size. - :vartype partition_size: str - """ - - partition_size: Optional[str] = rest_field( - name="partitionSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Partition size.""" - - @overload - def __init__( - self, - *, - partition_size: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class StorageProfile(_Model): - """StorageProfile of edge machine. - - :ivar poolable_disks_count: Number of storage disks in the device with $CanPool as true. - :vartype poolable_disks_count: int - """ - - poolable_disks_count: Optional[int] = rest_field(name="poolableDisksCount", visibility=["read"]) - """Number of storage disks in the device with $CanPool as true.""" - - class StorageS2dConfig(_Model): """The S2D (Storage Spaces Direct) configuration for AzureStackHCI Cluster storage. @@ -9839,102 +6986,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TargetDeviceConfiguration(_Model): - """Device configuration. - - :ivar network: Network configuration. - :vartype network: ~azure.mgmt.azurestackhci.models.NetworkConfiguration - :ivar host_name: Hostname of the device. - :vartype host_name: str - :ivar web_proxy: Web proxy configuration. - :vartype web_proxy: ~azure.mgmt.azurestackhci.models.WebProxyConfiguration - :ivar time: Time configuration. - :vartype time: ~azure.mgmt.azurestackhci.models.TimeConfiguration - :ivar storage: Storage configuration. - :vartype storage: ~azure.mgmt.azurestackhci.models.StorageConfiguration - """ - - network: Optional["_models.NetworkConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Network configuration.""" - host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"]) - """Hostname of the device.""" - web_proxy: Optional["_models.WebProxyConfiguration"] = rest_field( - name="webProxy", visibility=["read", "create", "update", "delete", "query"] - ) - """Web proxy configuration.""" - time: Optional["_models.TimeConfiguration"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Time configuration.""" - storage: Optional["_models.StorageConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Storage configuration.""" - - @overload - def __init__( - self, - *, - network: Optional["_models.NetworkConfiguration"] = None, - host_name: Optional[str] = None, - web_proxy: Optional["_models.WebProxyConfiguration"] = None, - time: Optional["_models.TimeConfiguration"] = None, - storage: Optional["_models.StorageConfiguration"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class TimeConfiguration(_Model): - """Time configuration. - - :ivar primary_time_server: Primary NTP server. - :vartype primary_time_server: str - :ivar secondary_time_server: Secondary NTP server. - :vartype secondary_time_server: str - :ivar time_zone: Time zone. - :vartype time_zone: str - """ - - primary_time_server: Optional[str] = rest_field( - name="primaryTimeServer", visibility=["read", "create", "update", "delete", "query"] - ) - """Primary NTP server.""" - secondary_time_server: Optional[str] = rest_field( - name="secondaryTimeServer", visibility=["read", "create", "update", "delete", "query"] - ) - """Secondary NTP server.""" - time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) - """Time zone.""" - - @overload - def __init__( - self, - *, - primary_time_server: Optional[str] = None, - secondary_time_server: Optional[str] = None, - time_zone: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class Update(ProxyResource): """Update details. @@ -9981,77 +7032,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UpdateContent(ProxyResource): - """Represents a update content. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.azurestackhci.models.UpdateContentProperties - """ - - properties: Optional["_models.UpdateContentProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.UpdateContentProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateContentProperties(_Model): - """Represents properties of a update content resource. - - :ivar update_payloads: Represents the payloads of a update content resource. Required. - :vartype update_payloads: list[~azure.mgmt.azurestackhci.models.ContentPayload] - """ - - update_payloads: list["_models.ContentPayload"] = rest_field( - name="updatePayloads", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents the payloads of a update content resource. Required.""" - - @overload - def __init__( - self, - *, - update_payloads: list["_models.ContentPayload"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class UpdatePrerequisite(_Model): """If update State is HasPrerequisite, this property contains an array of objects describing prerequisite updates before installing this update. Otherwise, it is empty. @@ -10769,57 +7749,6 @@ class UserAssignedIdentity(_Model): """The client ID of the assigned identity.""" -class UserDetails(_Model): - """User configuration. - - :ivar user_name: Name of the user. Required. - :vartype user_name: str - :ivar secret_type: Type of the secret used for authentication. Required. Known values are: - "KeyVault" and "SshPubKey". - :vartype secret_type: str or ~azure.mgmt.azurestackhci.models.SecretType - :ivar secret_location: Location of the secret used for authentication. - :vartype secret_location: str - :ivar ssh_pub_key: SSH Public Key for the user. - :vartype ssh_pub_key: list[str] - """ - - user_name: str = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"]) - """Name of the user. Required.""" - secret_type: Union[str, "_models.SecretType"] = rest_field( - name="secretType", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of the secret used for authentication. Required. Known values are: \"KeyVault\" and - \"SshPubKey\".""" - secret_location: Optional[str] = rest_field( - name="secretLocation", visibility=["read", "create", "update", "delete", "query"] - ) - """Location of the secret used for authentication.""" - ssh_pub_key: Optional[list[str]] = rest_field( - name="sshPubKey", visibility=["read", "create", "update", "delete", "query"] - ) - """SSH Public Key for the user.""" - - @overload - def __init__( - self, - *, - user_name: str, - secret_type: Union[str, "_models.SecretType"], - secret_location: Optional[str] = None, - ssh_pub_key: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class ValidatedSolutionRecipe(ProxyResource): """Represents a validated solution recipe resource. @@ -11244,68 +8173,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ValidateOwnershipVouchersRequest(_Model): - """Validate Ownership Voucher Request. - - :ivar ownership_voucher_details: Ownership Voucher Details. Required. - :vartype ownership_voucher_details: - list[~azure.mgmt.azurestackhci.models.OwnershipVoucherDetails] - """ - - ownership_voucher_details: list["_models.OwnershipVoucherDetails"] = rest_field( - name="ownershipVoucherDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """Ownership Voucher Details. Required.""" - - @overload - def __init__( - self, - *, - ownership_voucher_details: list["_models.OwnershipVoucherDetails"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ValidateOwnershipVouchersResponse(_Model): - """Validate Ownership Voucher Response. - - :ivar ownership_voucher_validation_details: Ownership Voucher Validation Details. Required. - :vartype ownership_voucher_validation_details: - list[~azure.mgmt.azurestackhci.models.OwnershipVoucherValidationDetails] - """ - - ownership_voucher_validation_details: list["_models.OwnershipVoucherValidationDetails"] = rest_field( - name="ownershipVoucherValidationDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """Ownership Voucher Validation Details. Required.""" - - @overload - def __init__( - self, - *, - ownership_voucher_validation_details: list["_models.OwnershipVoucherValidationDetails"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class ValidateRequest(_Model): """The validate request for Edge Device. @@ -11352,45 +8219,3 @@ class ValidateResponse(_Model): status: Optional[str] = rest_field(visibility=["read"]) """edge device validation status.""" - - -class WebProxyConfiguration(_Model): - """Web proxy configuration. - - :ivar connection_uri: Connection URI of the web proxy. - :vartype connection_uri: str - :ivar port: Port of the web proxy. - :vartype port: str - :ivar bypass_list: Bypass list for the web proxy. - :vartype bypass_list: list[str] - """ - - connection_uri: Optional[str] = rest_field( - name="connectionUri", visibility=["read", "create", "update", "delete", "query"] - ) - """Connection URI of the web proxy.""" - port: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Port of the web proxy.""" - bypass_list: Optional[list[str]] = rest_field( - name="bypassList", visibility=["read", "create", "update", "delete", "query"] - ) - """Bypass list for the web proxy.""" - - @overload - def __init__( - self, - *, - connection_uri: Optional[str] = None, - port: Optional[str] = None, - bypass_list: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py index ada4c640dec6..08721ac8e7e8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py @@ -12,10 +12,6 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._operations import KubernetesVersionsOperations # type: ignore -from ._operations import PlatformUpdatesOperations # type: ignore -from ._operations import OsImagesOperations # type: ignore -from ._operations import UpdateContentsOperations # type: ignore from ._operations import Operations # type: ignore from ._operations import ArcSettingsOperations # type: ignore from ._operations import OffersOperations # type: ignore @@ -24,18 +20,12 @@ from ._operations import EdgeDeviceJobsOperations # type: ignore from ._operations import EdgeDevicesOperations # type: ignore from ._operations import ExtensionsOperations # type: ignore -from ._operations import PublishersOperations # type: ignore from ._operations import SecuritySettingsOperations # type: ignore from ._operations import SkusOperations # type: ignore from ._operations import UpdateRunsOperations # type: ignore from ._operations import UpdatesOperations # type: ignore from ._operations import UpdateSummariesOperationGroupOperations # type: ignore from ._operations import ValidatedSolutionRecipesOperations # type: ignore -from ._operations import EdgeMachinesOperations # type: ignore -from ._operations import EdgeMachineJobsOperations # type: ignore -from ._operations import OwnershipVouchersOperations # type: ignore -from ._operations import ClusterJobsOperations # type: ignore -from ._operations import DevicePoolsOperations # type: ignore from ._operations import UpdateSummariesOperations # type: ignore from ._patch import __all__ as _patch_all @@ -43,10 +33,6 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "KubernetesVersionsOperations", - "PlatformUpdatesOperations", - "OsImagesOperations", - "UpdateContentsOperations", "Operations", "ArcSettingsOperations", "OffersOperations", @@ -55,18 +41,12 @@ "EdgeDeviceJobsOperations", "EdgeDevicesOperations", "ExtensionsOperations", - "PublishersOperations", "SecuritySettingsOperations", "SkusOperations", "UpdateRunsOperations", "UpdatesOperations", "UpdateSummariesOperationGroupOperations", "ValidatedSolutionRecipesOperations", - "EdgeMachinesOperations", - "EdgeMachineJobsOperations", - "OwnershipVouchersOperations", - "ClusterJobsOperations", - "DevicePoolsOperations", "UpdateSummariesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py index b48cc967fac8..31524339c323 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py @@ -47,199 +47,11 @@ _SERIALIZER.client_side_validation = False -def build_kubernetes_versions_list_by_subscription_location_resource_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/kubernetesVersions" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_platform_updates_get_request( - location: str, platform_update_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/platformUpdates/{platformUpdateName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "platformUpdateName": _SERIALIZER.url("platform_update_name", platform_update_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_platform_updates_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/platformUpdates" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_os_images_get_request(location: str, os_image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = ( - "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/osImages/{osImageName}" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "osImageName": _SERIALIZER.url("os_image_name", os_image_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_os_images_list_by_subscription_location_resource_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/osImages" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_contents_get_request( - location: str, update_content_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/updateContents/{updateContentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "updateContentName": _SERIALIZER.url("update_content_name", update_content_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_contents_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/updateContents" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +72,7 @@ def build_arc_settings_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -290,7 +102,7 @@ def build_arc_settings_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -322,7 +134,7 @@ def build_arc_settings_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -352,7 +164,7 @@ def build_arc_settings_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}" path_format_arguments = { @@ -376,7 +188,7 @@ def build_arc_settings_list_by_cluster_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +216,7 @@ def build_arc_settings_generate_password_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -433,7 +245,7 @@ def build_arc_settings_create_identity_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -463,7 +275,7 @@ def build_arc_settings_reconcile_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -494,7 +306,7 @@ def build_arc_settings_consent_and_install_default_extensions_request( # pylint _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -522,7 +334,7 @@ def build_arc_settings_initialize_disable_process_request( # pylint: disable=na ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess" path_format_arguments = { @@ -553,7 +365,7 @@ def build_offers_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -591,7 +403,7 @@ def build_offers_list_by_publisher_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -622,7 +434,7 @@ def build_offers_list_by_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -652,7 +464,7 @@ def build_clusters_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -681,7 +493,7 @@ def build_clusters_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -712,7 +524,7 @@ def build_clusters_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -741,7 +553,7 @@ def build_clusters_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}" path_format_arguments = { @@ -764,7 +576,7 @@ def build_clusters_list_by_resource_group_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -793,7 +605,7 @@ def build_clusters_list_by_subscription_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -820,7 +632,7 @@ def build_clusters_update_secrets_locations_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -851,7 +663,7 @@ def build_clusters_upload_certificate_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate" path_format_arguments = { @@ -878,7 +690,7 @@ def build_clusters_create_identity_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -907,7 +719,7 @@ def build_clusters_extend_software_assurance_benefit_request( # pylint: disable _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -931,37 +743,6 @@ def build_clusters_extend_software_assurance_benefit_request( # pylint: disable return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_clusters_change_ring_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/changeRing" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_clusters_trigger_log_collection_request( # pylint: disable=name-too-long resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -969,7 +750,7 @@ def build_clusters_trigger_log_collection_request( # pylint: disable=name-too-l _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1000,7 +781,7 @@ def build_clusters_configure_remote_support_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1034,7 +815,7 @@ def build_deployment_settings_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1068,7 +849,7 @@ def build_deployment_settings_create_or_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1102,7 +883,7 @@ def build_deployment_settings_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}" path_format_arguments = { @@ -1126,7 +907,7 @@ def build_deployment_settings_list_by_clusters_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1154,7 +935,7 @@ def build_edge_device_jobs_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1183,7 +964,7 @@ def build_edge_device_jobs_create_or_update_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1212,7 +993,7 @@ def build_edge_device_jobs_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/jobs/{jobsName}" path_format_arguments = { @@ -1235,7 +1016,7 @@ def build_edge_device_jobs_list_by_edge_device_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1260,7 +1041,7 @@ def build_edge_devices_get_request(resource_uri: str, edge_device_name: str = "d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1288,7 +1069,7 @@ def build_edge_devices_create_or_update_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1316,7 +1097,7 @@ def build_edge_devices_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}" path_format_arguments = { @@ -1336,7 +1117,7 @@ def build_edge_devices_list_request(resource_uri: str, **kwargs: Any) -> HttpReq _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1363,7 +1144,7 @@ def build_edge_devices_validate_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1397,7 +1178,7 @@ def build_extensions_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1433,7 +1214,7 @@ def build_extensions_create_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1471,7 +1252,7 @@ def build_extensions_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1507,7 +1288,7 @@ def build_extensions_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}" path_format_arguments = { @@ -1532,7 +1313,7 @@ def build_extensions_list_by_arc_setting_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1567,7 +1348,7 @@ def build_extensions_upgrade_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}/upgrade" path_format_arguments = { @@ -1590,63 +1371,6 @@ def build_extensions_upgrade_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_publishers_get_request( - resource_group_name: str, cluster_name: str, publisher_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_publishers_list_by_cluster_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_security_settings_get_request( resource_group_name: str, cluster_name: str, @@ -1657,7 +1381,7 @@ def build_security_settings_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1691,7 +1415,7 @@ def build_security_settings_create_or_update_request( # pylint: disable=name-to _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1725,7 +1449,7 @@ def build_security_settings_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}" path_format_arguments = { @@ -1749,7 +1473,7 @@ def build_security_settings_list_by_clusters_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1785,7 +1509,7 @@ def build_skus_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1825,7 +1549,7 @@ def build_skus_list_by_offer_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1862,7 +1586,7 @@ def build_update_runs_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1898,7 +1622,7 @@ def build_update_runs_put_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1934,7 +1658,7 @@ def build_update_runs_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" path_format_arguments = { @@ -1959,7 +1683,7 @@ def build_update_runs_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1988,7 +1712,7 @@ def build_updates_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2018,7 +1742,7 @@ def build_updates_put_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2048,7 +1772,7 @@ def build_updates_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" path_format_arguments = { @@ -2072,7 +1796,7 @@ def build_updates_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2099,7 +1823,7 @@ def build_updates_post_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/apply" path_format_arguments = { @@ -2122,7 +1846,7 @@ def build_updates_prepare_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/prepare" path_format_arguments = { @@ -2147,7 +1871,7 @@ def build_update_summaries_operation_group_check_updates_request( # pylint: dis _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default/checkUpdates" path_format_arguments = { @@ -2173,7 +1897,7 @@ def build_update_summaries_operation_group_check_health_request( # pylint: disa ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default/checkHealth" path_format_arguments = { @@ -2196,7 +1920,7 @@ def build_validated_solution_recipes_get_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2226,7 +1950,7 @@ def build_validated_solution_recipes_list_by_subscription_location_resource_requ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2247,21 +1971,21 @@ def build_validated_solution_recipes_list_by_subscription_location_resource_requ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_edge_machines_get_request( - resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any +def build_update_summaries_get_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2275,22 +1999,22 @@ def build_edge_machines_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_edge_machines_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any +def build_update_summaries_put_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2306,49 +2030,18 @@ def build_edge_machines_create_or_update_request( # pylint: disable=name-too-lo return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_edge_machines_update_request( - resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any +def build_update_summaries_delete_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_edge_machines_delete_request( - resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2359,20 +2052,21 @@ def build_edge_machines_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_edge_machines_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any +def build_update_summaries_list_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-30")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2386,6035 +2080,329 @@ def build_edge_machines_list_by_resource_group_request( # pylint: disable=name- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_edge_machines_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`operations` attribute. + """ - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/edgeMachines" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - _url: str = _url.format(**path_format_arguments) # type: ignore + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): + if not next_link: -def build_edge_machine_jobs_get_request( - resource_group_name: str, edge_machine_name: str, jobs_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}/jobs/{jobsName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), - "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), - } + return _request - _url: str = _url.format(**path_format_arguments) # type: ignore + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + def get_next(next_link=None): + _request = prepare_request(next_link) - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + return pipeline_response -def build_edge_machine_jobs_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, edge_machine_name: str, jobs_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + return ItemPaged(get_next, extract_data) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}/jobs/{jobsName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), - "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), - } +class ArcSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - _url: str = _url.format(**path_format_arguments) # type: ignore + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`arc_settings` attribute. + """ - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.ArcSetting: + """Get ArcSetting resource details of HCI Cluster. - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} -def build_edge_machine_jobs_delete_request( - resource_group_name: str, edge_machine_name: str, jobs_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}/jobs/{jobsName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), - "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), - } + _request = build_arc_settings_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _url: str = _url.format(**path_format_arguments) # type: ignore + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + response = pipeline_response.http_response - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - -def build_edge_machine_jobs_list_request( - resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}/jobs" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_ownership_vouchers_validate_request( # pylint: disable=name-too-long - resource_group_name: str, location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/locations/{location}/validateOwnershipVouchers" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cluster_jobs_get_request( - resource_group_name: str, cluster_name: str, jobs_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/jobs/{jobsName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cluster_jobs_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, cluster_name: str, jobs_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/jobs/{jobsName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cluster_jobs_delete_request( - resource_group_name: str, cluster_name: str, jobs_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/jobs/{jobsName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_cluster_jobs_list_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/jobs" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_device_pools_get_request( - resource_group_name: str, device_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/devicePools/{devicePoolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "devicePoolName": _SERIALIZER.url("device_pool_name", device_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_device_pools_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, device_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/devicePools/{devicePoolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "devicePoolName": _SERIALIZER.url("device_pool_name", device_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_device_pools_delete_request( - resource_group_name: str, device_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/devicePools/{devicePoolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "devicePoolName": _SERIALIZER.url("device_pool_name", device_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_device_pools_update_request( - resource_group_name: str, device_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/devicePools/{devicePoolName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "devicePoolName": _SERIALIZER.url("device_pool_name", device_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_device_pools_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/devicePools" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_device_pools_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/devicePools" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_device_pools_claim_devices_request( - resource_group_name: str, device_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/devicePools/{devicePoolName}/claimDevices" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "devicePoolName": _SERIALIZER.url("device_pool_name", device_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_device_pools_release_devices_request( # pylint: disable=name-too-long - resource_group_name: str, device_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/devicePools/{devicePoolName}/releaseDevices" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "devicePoolName": _SERIALIZER.url("device_pool_name", device_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_summaries_get_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_summaries_put_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_summaries_delete_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_update_summaries_list_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-04-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class KubernetesVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`kubernetes_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_subscription_location_resource( - self, location: str, **kwargs: Any - ) -> ItemPaged["_models.KubernetesVersion"]: - """List all kubernetes versions. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of KubernetesVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.KubernetesVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.KubernetesVersion]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_kubernetes_versions_list_by_subscription_location_resource_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.KubernetesVersion], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class PlatformUpdatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`platform_updates` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "location", "platform_update_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def get(self, location: str, platform_update_name: str, **kwargs: Any) -> _models.PlatformUpdate: - """Get a platform update. - - :param location: The name of the Azure region. Required. - :type location: str - :param platform_update_name: The name of the PlatformUpdate. Required. - :type platform_update_name: str - :return: PlatformUpdate. The PlatformUpdate is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.PlatformUpdate - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PlatformUpdate] = kwargs.pop("cls", None) - - _request = build_platform_updates_get_request( - location=location, - platform_update_name=platform_update_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PlatformUpdate, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.PlatformUpdate"]: - """List all platform updates. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of PlatformUpdate - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.PlatformUpdate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.PlatformUpdate]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_platform_updates_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.PlatformUpdate], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class OsImagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`os_images` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "location", "os_image_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def get(self, location: str, os_image_name: str, **kwargs: Any) -> _models.OsImage: - """Get a os image. - - :param location: The name of the Azure region. Required. - :type location: str - :param os_image_name: The name of the OsImage. Required. - :type os_image_name: str - :return: OsImage. The OsImage is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.OsImage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OsImage] = kwargs.pop("cls", None) - - _request = build_os_images_get_request( - location=location, - os_image_name=os_image_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.OsImage, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_subscription_location_resource(self, location: str, **kwargs: Any) -> ItemPaged["_models.OsImage"]: - """List all os images. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of OsImage - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.OsImage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.OsImage]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_os_images_list_by_subscription_location_resource_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.OsImage], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class UpdateContentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`update_contents` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "location", "update_content_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def get(self, location: str, update_content_name: str, **kwargs: Any) -> _models.UpdateContent: - """Gets content for an update. - - :param location: The name of the Azure region. Required. - :type location: str - :param update_content_name: The name of the UpdateContent. Required. - :type update_content_name: str - :return: UpdateContent. The UpdateContent is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateContent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.UpdateContent] = kwargs.pop("cls", None) - - _request = build_update_contents_get_request( - location=location, - update_content_name=update_content_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.UpdateContent, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.UpdateContent"]: - """List all update contents. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of UpdateContent - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.UpdateContent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.UpdateContent]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_update_contents_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.UpdateContent], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """List the operations for the provider. - - :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Operation], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ArcSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`arc_settings` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.ArcSetting: - """Get ArcSetting resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - _request = build_arc_settings_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ArcSetting, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: _models.ArcSetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: Union[_models.ArcSetting, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Is one of the following types: ArcSetting, JSON, IO[bytes] Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting or JSON or IO[bytes] - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(arc_setting, (IOBase, bytes)): - _content = arc_setting - else: - _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_arc_settings_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ArcSetting, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: _models.ArcSettingsPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: Union[_models.ArcSettingsPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Is one of the following - types: ArcSettingsPatch, JSON, IO[bytes] Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch or JSON or IO[bytes] - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(arc_setting, (IOBase, bytes)): - _content = arc_setting - else: - _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_arc_settings_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ArcSetting, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_arc_settings_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete ArcSetting resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged["_models.ArcSetting"]: - """Get ArcSetting resources of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of ArcSetting - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ArcSetting]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_arc_settings_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ArcSetting], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def generate_password( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.PasswordCredential: - """Generate password for arc settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: PasswordCredential. The PasswordCredential is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) - - _request = build_arc_settings_generate_password_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PasswordCredential, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_identity_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_arc_settings_create_identity_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_create_identity( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> LROPoller[_models.ArcIdentityResponse]: - """Create Aad identity for arc settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of LROPoller that returns ArcIdentityResponse. The ArcIdentityResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_identity_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.ArcIdentityResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ArcIdentityResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ArcIdentityResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _reconcile_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(reconcile_arc_settings_request, (IOBase, bytes)): - _content = reconcile_arc_settings_request - else: - _content = json.dumps(reconcile_arc_settings_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_arc_settings_reconcile_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_reconcile( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: _models.ReconcileArcSettingsRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ArcSetting]: - """Reconcile Arc Settings with information related to all nodes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. - :type reconcile_arc_settings_request: - ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_reconcile( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ArcSetting]: - """Reconcile Arc Settings with information related to all nodes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. - :type reconcile_arc_settings_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_reconcile( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ArcSetting]: - """Reconcile Arc Settings with information related to all nodes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. - :type reconcile_arc_settings_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_reconcile( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ArcSetting]: - """Reconcile Arc Settings with information related to all nodes. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Is one of the - following types: ReconcileArcSettingsRequest, JSON, IO[bytes] Required. - :type reconcile_arc_settings_request: - ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest or JSON or IO[bytes] - :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._reconcile_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - reconcile_arc_settings_request=reconcile_arc_settings_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.ArcSetting, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ArcSetting].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ArcSetting]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def consent_and_install_default_extensions( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.ArcSetting: - """Add consent time for default extensions and initiate extensions installation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - _request = build_arc_settings_consent_and_install_default_extensions_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ArcSetting, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _initialize_disable_process_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_arc_settings_initialize_disable_process_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_initialize_disable_process( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Initializes ARC Disable process on the cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._initialize_disable_process_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class OffersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`offers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - *, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.Offer: - """Get Offer resource details within a publisher of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: Offer. The Offer is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Offer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Offer] = kwargs.pop("cls", None) - - _request = build_offers_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Offer, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_publisher( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - *, - expand: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.Offer"]: - """List Offers available for a publisher within the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: An iterator like instance of Offer - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Offer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_offers_list_by_publisher_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Offer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, *, expand: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.Offer"]: - """List Offers available across publishers for the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: An iterator like instance of Offer - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Offer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_offers_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Offer], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ClustersOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`clusters` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: - """Get HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - _request = build_clusters_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Cluster, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: _models.Cluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: Union[_models.Cluster, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Is one of the following types: Cluster, JSON, - IO[bytes] Required. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster or JSON or IO[bytes] - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(cluster, (IOBase, bytes)): - _content = cluster - else: - _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Cluster, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: _models.ClusterPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: Union[_models.ClusterPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Is one of the following types: ClusterPatch, JSON, - IO[bytes] Required. - :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch or JSON or IO[bytes] - :return: Cluster. The Cluster is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(cluster, (IOBase, bytes)): - _content = cluster - else: - _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Cluster, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_clusters_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Cluster"]: - """List all HCI clusters in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of Cluster - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_clusters_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Cluster], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Cluster"]: - """List all HCI clusters in a subscription. - - :return: An iterator like instance of Cluster - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_clusters_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Cluster], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _update_secrets_locations_initial( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_update_secrets_locations_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update_secrets_locations( - self, - resource_group_name: str, - cluster_name: str, - body: _models.SecretsLocationsChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Update cluster secrets locations. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_secrets_locations( - self, - resource_group_name: str, - cluster_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Update cluster secrets locations. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_secrets_locations( - self, - resource_group_name: str, - cluster_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Update cluster secrets locations. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_secrets_locations( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Update cluster secrets locations. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Is one of the following types: - SecretsLocationsChangeRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest or JSON or IO[bytes] - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_secrets_locations_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _upload_certificate_initial( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(upload_certificate_request, (IOBase, bytes)): - _content = upload_certificate_request - else: - _content = json.dumps(upload_certificate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_upload_certificate_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: _models.UploadCertificateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Is one of the following types: - UploadCertificateRequest, JSON, IO[bytes] Required. - :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest or - JSON or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._upload_certificate_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - upload_certificate_request=upload_certificate_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _create_identity_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_clusters_create_identity_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_create_identity( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> LROPoller[_models.ClusterIdentityResponse]: - """Create cluster identity. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of LROPoller that returns ClusterIdentityResponse. The - ClusterIdentityResponse is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_identity_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.ClusterIdentityResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ClusterIdentityResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClusterIdentityResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _extend_software_assurance_benefit_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(software_assurance_change_request, (IOBase, bytes)): - _content = software_assurance_change_request - else: - _content = json.dumps(software_assurance_change_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_extend_software_assurance_benefit_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: _models.SoftwareAssuranceChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Is one of - the following types: SoftwareAssuranceChangeRequest, JSON, IO[bytes] Required. - :type software_assurance_change_request: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest or JSON or IO[bytes] - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._extend_software_assurance_benefit_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - software_assurance_change_request=software_assurance_change_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _change_ring_initial( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: Union[_models.ChangeRingRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(change_ring_request, (IOBase, bytes)): - _content = change_ring_request - else: - _content = json.dumps(change_ring_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_change_ring_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_change_ring( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: _models.ChangeRingRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Changes ring of a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param change_ring_request: Change ring request payload. Required. - :type change_ring_request: ~azure.mgmt.azurestackhci.models.ChangeRingRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_change_ring( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Changes ring of a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param change_ring_request: Change ring request payload. Required. - :type change_ring_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_change_ring( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Changes ring of a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param change_ring_request: Change ring request payload. Required. - :type change_ring_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_change_ring( - self, - resource_group_name: str, - cluster_name: str, - change_ring_request: Union[_models.ChangeRingRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Changes ring of a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param change_ring_request: Change ring request payload. Is one of the following types: - ChangeRingRequest, JSON, IO[bytes] Required. - :type change_ring_request: ~azure.mgmt.azurestackhci.models.ChangeRingRequest or JSON or - IO[bytes] - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._change_ring_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - change_ring_request=change_ring_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _trigger_log_collection_initial( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(log_collection_request, (IOBase, bytes)): - _content = log_collection_request - else: - _content = json.dumps(log_collection_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_trigger_log_collection_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: _models.LogCollectionRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Is one of the following - types: LogCollectionRequest, JSON, IO[bytes] Required. - :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest or JSON or - IO[bytes] - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._trigger_log_collection_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - log_collection_request=log_collection_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _configure_remote_support_initial( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(remote_support_request, (IOBase, bytes)): - _content = remote_support_request - else: - _content = json.dumps(remote_support_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_clusters_configure_remote_support_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: _models.RemoteSupportRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Is one of the - following types: RemoteSupportRequest, JSON, IO[bytes] Required. - :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest or JSON or - IO[bytes] - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._configure_remote_support_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - remote_support_request=remote_support_request, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Cluster, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class DeploymentSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`deployment_settings` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> _models.DeploymentSetting: - """Get a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: DeploymentSetting. The DeploymentSetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.DeploymentSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - - _request = build_deployment_settings_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DeploymentSetting, response.json()) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], - deployment_settings_name: str = "default", - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_deployment_settings_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: _models.DeploymentSetting, - deployment_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def begin_create_or_update( + def create( self, resource_group_name: str, cluster_name: str, - resource: JSON, - deployment_settings_name: str = "default", + arc_setting_name: str, + arc_setting: _models.ArcSetting, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create( self, resource_group_name: str, cluster_name: str, - resource: IO[bytes], - deployment_settings_name: str = "default", + arc_setting_name: str, + arc_setting: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace - def begin_create_or_update( + @overload + def create( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], - deployment_settings_name: str = "default", - **kwargs: Any - ) -> LROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Is one of the following types: DeploymentSetting, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting or JSON or IO[bytes] - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - resource=resource, - deployment_settings_name=deployment_settings_name, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DeploymentSetting, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DeploymentSetting].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DeploymentSetting]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_deployment_settings_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> LROPoller[None]: - """Delete a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - deployment_settings_name=deployment_settings_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged["_models.DeploymentSetting"]: - """List DeploymentSetting resources by Clusters. + arc_setting_name: str, + arc_setting: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :return: An iterator like instance of DeploymentSetting - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DeploymentSetting]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_deployment_settings_list_by_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DeploymentSetting], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class EdgeDeviceJobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`edge_device_jobs` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get( - self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any - ) -> _models.EdgeDeviceJob: - """Get a EdgeDeviceJob. + def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: Union[_models.ArcSetting, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: EdgeDeviceJob. The EdgeDeviceJob is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Is one of the following types: ArcSetting, JSON, IO[bytes] Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting or JSON or IO[bytes] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8425,16 +2413,27 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - _request = build_edge_device_jobs_get_request( - resource_uri=resource_uri, - jobs_name=jobs_name, - edge_device_name=edge_device_name, + content_type = content_type or "application/json" + _content = None + if isinstance(arc_setting, (IOBase, bytes)): + _content = arc_setting + else: + _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_arc_settings_create_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -8467,265 +2466,202 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) + deserialized = _deserialize(_models.ArcSetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( - self, - resource_uri: str, - jobs_name: str, - resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_edge_device_jobs_create_or_update_request( - resource_uri=resource_uri, - jobs_name=jobs_name, - edge_device_name=edge_device_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @overload - def begin_create_or_update( + def update( self, - resource_uri: str, - jobs_name: str, - resource: _models.EdgeDeviceJob, - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: _models.ArcSettingsPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeDeviceJob]: - """Create a EdgeDeviceJob. + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def update( self, - resource_uri: str, - jobs_name: str, - resource: JSON, - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeDeviceJob]: - """Create a EdgeDeviceJob. + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def update( self, - resource_uri: str, - jobs_name: str, - resource: IO[bytes], - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeDeviceJob]: - """Create a EdgeDeviceJob. + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def update( self, - resource_uri: str, - jobs_name: str, - resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: Union[_models.ArcSettingsPatch, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.EdgeDeviceJob]: - """Create a EdgeDeviceJob. + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param resource: Resource create parameters. Is one of the following types: EdgeDeviceJob, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob or JSON or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Is one of the following + types: ArcSettingsPatch, JSON, IO[bytes] Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch or JSON or IO[bytes] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_uri=resource_uri, - jobs_name=jobs_name, - resource=resource, - edge_device_name=edge_device_name, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(arc_setting, (IOBase, bytes)): + _content = arc_setting + else: + _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_arc_settings_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.EdgeDeviceJob].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EdgeDeviceJob]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore def _delete_initial( - self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8740,10 +2676,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_edge_device_jobs_delete_request( - resource_uri=resource_uri, - jobs_name=jobs_name, - edge_device_name=edge_device_name, + _request = build_arc_settings_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8761,7 +2698,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -8775,7 +2712,9 @@ def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -8787,17 +2726,18 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a EdgeDeviceJob. + """Delete ArcSetting resource details of HCI Cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param jobs_name: Name of EdgeDevice Job. Required. - :type jobs_name: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -8811,9 +2751,9 @@ def begin_delete( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( - resource_uri=resource_uri, - jobs_name=jobs_name, - edge_device_name=edge_device_name, + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -8848,24 +2788,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_by_edge_device( - self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any - ) -> ItemPaged["_models.EdgeDeviceJob"]: - """List EdgeDeviceJob resources by EdgeDevice. + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.ArcSetting"]: + """Get ArcSetting resources of HCI Cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An iterator like instance of EdgeDeviceJob - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ArcSetting + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ArcSetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EdgeDeviceJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ArcSetting]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8878,9 +2818,10 @@ def list_by_edge_device( def prepare_request(next_link=None): if not next_link: - _request = build_edge_device_jobs_list_by_edge_device_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, + _request = build_arc_settings_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8903,7 +2844,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8917,7 +2861,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.EdgeDeviceJob], + List[_models.ArcSetting], deserialized.get("value", []), ) if cls: @@ -8945,35 +2889,22 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - -class EdgeDevicesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`edge_devices` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def get(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> _models.EdgeDevice: - """Get a EdgeDevice. + def generate_password( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.PasswordCredential: + """Generate password for arc settings. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: EdgeDevice. The EdgeDevice is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.EdgeDevice + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: PasswordCredential. The PasswordCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8987,11 +2918,13 @@ def get(self, resource_uri: str, edge_device_name: str = "default", **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) - _request = build_edge_devices_get_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, + _request = build_arc_settings_generate_password_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9025,18 +2958,160 @@ def get(self, resource_uri: str, edge_device_name: str = "default", **kwargs: An if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.EdgeDevice, response.json()) + deserialized = _deserialize(_models.PasswordCredential, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( + def _create_identity_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_arc_settings_create_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_identity( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> LROPoller[_models.ArcIdentityResponse]: + """Create Aad identity for arc settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An instance of LROPoller that returns ArcIdentityResponse. The ArcIdentityResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArcIdentityResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ArcIdentityResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ArcIdentityResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _reconcile_initial( self, - resource_uri: str, - resource: Union[_models.EdgeDevice, JSON, IO[bytes]], - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -9055,14 +3130,16 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(reconcile_arc_settings_request, (IOBase, bytes)): + _content = reconcile_arc_settings_request else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(reconcile_arc_settings_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_edge_devices_create_or_update_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, + _request = build_arc_settings_reconcile_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -9082,7 +3159,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9095,10 +3172,11 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -9109,125 +3187,144 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_reconcile( self, - resource_uri: str, - resource: _models.EdgeDevice, - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: _models.ReconcileArcSettingsRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. + ) -> LROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: + ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_reconcile( self, - resource_uri: str, - resource: JSON, - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. + ) -> LROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_reconcile( self, - resource_uri: str, - resource: IO[bytes], - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. + ) -> LROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_reconcile( self, - resource_uri: str, - resource: Union[_models.EdgeDevice, JSON, IO[bytes]], - edge_device_name: str = "default", + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. + ) -> LROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param resource: Resource create parameters. Is one of the following types: EdgeDevice, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice or JSON or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Is one of the + following types: ReconcileArcSettingsRequest, JSON, IO[bytes] Required. + :type reconcile_arc_settings_request: + ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest or JSON or IO[bytes] + :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( - resource_uri=resource_uri, - resource=resource, - edge_device_name=edge_device_name, + raw_result = self._reconcile_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + reconcile_arc_settings_request=reconcile_arc_settings_request, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -9238,10 +3335,17 @@ def begin_create_or_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): + response_headers = {} response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeDevice, response.json()) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArcSetting, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized path_format_arguments = { @@ -9257,17 +3361,95 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.EdgeDevice].from_continuation_token( + return LROPoller[_models.ArcSetting].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.EdgeDevice]( + return LROPoller[_models.ArcSetting]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> Iterator[bytes]: + @distributed_trace + def consent_and_install_default_extensions( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.ArcSetting: + """Add consent time for default extensions and initiate extensions installation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + _request = build_arc_settings_consent_and_install_default_extensions_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _initialize_disable_process_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -9281,9 +3463,11 @@ def _delete_initial(self, resource_uri: str, edge_device_name: str = "default", cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_edge_devices_delete_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, + _request = build_arc_settings_initialize_disable_process_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9301,7 +3485,7 @@ def _delete_initial(self, resource_uri: str, edge_device_name: str = "default", response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9315,6 +3499,9 @@ def _delete_initial(self, resource_uri: str, edge_device_name: str = "default", response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -9326,14 +3513,19 @@ def _delete_initial(self, resource_uri: str, edge_device_name: str = "default", return deserialized # type: ignore @distributed_trace - def begin_delete(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> LROPoller[None]: - """Delete a EdgeDevice. + def begin_initialize_disable_process( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Initializes ARC Disable process on the cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -9346,9 +3538,10 @@ def begin_delete(self, resource_uri: str, edge_device_name: str = "default", **k lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( - resource_uri=resource_uri, - edge_device_name=edge_device_name, + raw_result = self._initialize_disable_process_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9382,21 +3575,250 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + +class OffersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`offers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.Offer: + """Get Offer resource details within a publisher of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: Offer. The Offer is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Offer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Offer] = kwargs.pop("cls", None) + + _request = build_offers_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Offer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_publisher( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.Offer"]: + """List Offers available for a publisher within the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Offer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Offer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_offers_list_by_publisher_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Offer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.EdgeDevice"]: - """List EdgeDevice resources by parent. + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Offer"]: + """List Offers available across publishers for the HCI Cluster. - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_uri: str - :return: An iterator like instance of EdgeDevice - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeDevice] + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Offer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Offer] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EdgeDevice]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9409,8 +3831,11 @@ def list(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.EdgeDevic def prepare_request(next_link=None): if not next_link: - _request = build_edge_devices_list_request( - resource_uri=resource_uri, + _request = build_offers_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + expand=expand, api_version=self._config.api_version, headers=_headers, params=_params, @@ -9433,7 +3858,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9447,7 +3875,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.EdgeDevice], + List[_models.Offer], deserialized.get("value", []), ) if cls: @@ -9457,270 +3885,33 @@ def extract_data(pipeline_response): def get_next(next_link=None): _request = prepare_request(next_link) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _validate_initial( - self, - resource_uri: str, - validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(validate_request, (IOBase, bytes)): - _content = validate_request - else: - _content = json.dumps(validate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_edge_devices_validate_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_validate( - self, - resource_uri: str, - validate_request: _models.ValidateRequest, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_validate( - self, - resource_uri: str, - validate_request: JSON, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: JSON - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_validate( - self, - resource_uri: str, - validate_request: IO[bytes], - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_validate( - self, - resource_uri: str, - validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> LROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Is one of the following types: - ValidateRequest, JSON, IO[bytes] Required. - :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest or JSON or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._validate_initial( - resource_uri=resource_uri, - validate_request=validate_request, - edge_device_name=edge_device_name, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.ValidateResponse, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + return pipeline_response - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ValidateResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ValidateResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return ItemPaged(get_next, extract_data) -class ExtensionsOperations: +class ClustersOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`extensions` attribute. + :attr:`clusters` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -9731,23 +3922,16 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> _models.Extension: - """Get particular Arc Extension of HCI Cluster. + def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: + """Get HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :return: Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Extension + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9761,13 +3945,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - _request = build_extensions_get_request( + _request = build_clusters_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9802,22 +3984,116 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Extension, response.json()) + deserialized = _deserialize(_models.Cluster, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_initial( + @overload + def create( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.Extension, JSON, IO[bytes]], + cluster: _models.Cluster, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Iterator[bytes]: + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: Union[_models.Cluster, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Is one of the following types: Cluster, JSON, + IO[bytes] Required. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster or JSON or IO[bytes] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -9830,20 +4106,18 @@ def _create_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(extension, (IOBase, bytes)): - _content = extension + if isinstance(cluster, (IOBase, bytes)): + _content = cluster else: - _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_extensions_create_request( + _request = build_clusters_create_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9857,18 +4131,19 @@ def _create_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -9876,218 +4151,187 @@ def _create_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Cluster, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_create( + def update( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: _models.Extension, + cluster: _models.ClusterPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Create Extension for HCI cluster. + ) -> _models.Cluster: + """Update an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: ~azure.mgmt.azurestackhci.models.Extension + :param cluster: Details of the HCI cluster. Required. + :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def update( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: JSON, + cluster: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Create Extension for HCI cluster. + ) -> _models.Cluster: + """Update an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: JSON + :param cluster: Details of the HCI cluster. Required. + :type cluster: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def update( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: IO[bytes], + cluster: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Create Extension for HCI cluster. + ) -> _models.Cluster: + """Update an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: IO[bytes] + :param cluster: Details of the HCI cluster. Required. + :type cluster: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create( + def update( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.Extension, JSON, IO[bytes]], + cluster: Union[_models.ClusterPatch, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Create Extension for HCI cluster. + ) -> _models.Cluster: + """Update an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Is one of the following - types: Extension, JSON, IO[bytes] Required. - :type extension: ~azure.mgmt.azurestackhci.models.Extension or JSON or IO[bytes] - :return: An instance of LROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :param cluster: Details of the HCI cluster. Is one of the following types: ClusterPatch, JSON, + IO[bytes] Required. + :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch or JSON or IO[bytes] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension=extension, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Extension, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(cluster, (IOBase, bytes)): + _content = cluster + else: + _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_clusters_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.Extension].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Extension]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.Cluster, response.json()) - def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -10096,28 +4340,16 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(extension, (IOBase, bytes)): - _content = extension - else: - _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_extensions_update_request( + _request = build_clusters_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -10134,7 +4366,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -10148,169 +4380,40 @@ def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: _models.ExtensionPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - @overload - def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Update Extension for HCI cluster. + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return deserialized # type: ignore @distributed_trace - def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Update Extension for HCI cluster. + def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete an HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Is one of the following - types: ExtensionPatch, JSON, IO[bytes] Required. - :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch or JSON or IO[bytes] - :return: An instance of LROPoller that returns Extension. The Extension is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension=extension, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10319,12 +4422,9 @@ def begin_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Extension, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10339,18 +4439,210 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Extension].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Extension]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Cluster"]: + """List all HCI clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Cluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Cluster"]: + """List all HCI clusters in a subscription. + + :return: An iterator like instance of Cluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Cluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - def _delete_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _update_secrets_locations_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10360,18 +4652,26 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_extensions_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_secrets_locations_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -10388,7 +4688,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -10402,9 +4702,6 @@ def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -10415,182 +4712,170 @@ def _delete_initial( return deserialized # type: ignore - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete particular Arc Extension of HCI Cluster. + @overload + def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: _models.SecretsLocationsChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Update cluster secrets locations. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + @overload + def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Update cluster secrets locations. - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + @overload + def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Update cluster secrets locations. - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def list_by_arc_setting( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> ItemPaged["_models.Extension"]: - """List all Extensions under ArcSetting resource. + def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Update cluster secrets locations. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An iterator like instance of Extension - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Extension] + :param body: The content of the action request. Is one of the following types: + SecretsLocationsChangeRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest or JSON or IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Extension]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_extensions_list_by_arc_setting_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Extension], - deserialized.get("value", []), + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_secrets_locations_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def get_long_running_output(pipeline_response): response = pipeline_response.http_response + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return ItemPaged(get_next, extract_data) + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _upgrade_initial( + def _upload_certificate_initial( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -10609,16 +4894,14 @@ def _upgrade_initial( content_type = content_type or "application/json" _content = None - if isinstance(extension_upgrade_parameters, (IOBase, bytes)): - _content = extension_upgrade_parameters + if isinstance(upload_certificate_request, (IOBase, bytes)): + _content = upload_certificate_request else: - _content = json.dumps(extension_upgrade_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(upload_certificate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_extensions_upgrade_request( + _request = build_clusters_upload_certificate_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -10655,6 +4938,7 @@ def _upgrade_initial( response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -10665,32 +4949,24 @@ def _upgrade_initial( return deserialized # type: ignore @overload - def begin_upgrade( + def begin_upload_certificate( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: _models.ExtensionUpgradeParameters, + upload_certificate_request: _models.UploadCertificateRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. + """Upload certificate. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10700,32 +4976,24 @@ def begin_upgrade( """ @overload - def begin_upgrade( + def begin_upload_certificate( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: JSON, + upload_certificate_request: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. + """Upload certificate. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: JSON + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10735,32 +5003,24 @@ def begin_upgrade( """ @overload - def begin_upgrade( + def begin_upload_certificate( self, resource_group_name: str, cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: IO[bytes], + upload_certificate_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. + """Upload certificate. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: IO[bytes] + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -10770,51 +5030,164 @@ def begin_upgrade( """ @distributed_trace - def begin_upgrade( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. + def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Is one of the following types: + UploadCertificateRequest, JSON, IO[bytes] Required. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest or + JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._upload_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + upload_certificate_request=upload_certificate_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_identity_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_clusters_create_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_identity( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> LROPoller[_models.ClusterIdentityResponse]: + """Create cluster identity. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Is one of the following types: ExtensionUpgradeParameters, JSON, IO[bytes] Required. - :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters - or JSON or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns ClusterIdentityResponse. The + ClusterIdentityResponse is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._upgrade_initial( + raw_result = self._create_identity_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension_upgrade_parameters=extension_upgrade_parameters, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10823,9 +5196,19 @@ def begin_upgrade( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ClusterIdentityResponse, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10840,61 +5223,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.ClusterIdentityResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class PublishersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`publishers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "publisher_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def get(self, resource_group_name: str, cluster_name: str, publisher_name: str, **kwargs: Any) -> _models.Publisher: - """Get Publisher resource details of HCI Cluster. + return LROPoller[_models.ClusterIdentityResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :return: Publisher. The Publisher is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Publisher - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _extend_software_assurance_benefit_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -10903,17 +5248,26 @@ def get(self, resource_group_name: str, cluster_name: str, publisher_name: str, } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(software_assurance_change_request, (IOBase, bytes)): + _content = software_assurance_change_request + else: + _content = json.dumps(software_assurance_change_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_publishers_get_request( + _request = build_clusters_extend_software_assurance_benefit_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - publisher_name=publisher_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -10923,19 +5277,18 @@ def get(self, resource_group_name: str, cluster_name: str, publisher_name: str, _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -10943,221 +5296,184 @@ def get(self, resource_group_name: str, cluster_name: str, publisher_name: str, ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Publisher, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged["_models.Publisher"]: - """List Publishers available for the HCI Cluster. + @overload + def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: _models.SoftwareAssuranceChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :return: An iterator like instance of Publisher - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Publisher] + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Publisher]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_publishers_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Publisher], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + @overload + def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. -class SecuritySettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`security_settings` attribute. - """ + @overload + def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any - ) -> _models.SecuritySetting: - """Get a SecuritySetting. + def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: SecuritySetting. The SecuritySetting is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.SecuritySetting + :param software_assurance_change_request: Software Assurance Change Request Payload. Is one of + the following types: SoftwareAssuranceChangeRequest, JSON, IO[bytes] Required. + :type software_assurance_change_request: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest or JSON or IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._extend_software_assurance_benefit_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + software_assurance_change_request=software_assurance_change_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_security_settings_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.SecuritySetting, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _create_or_update_initial( + def _trigger_log_collection_initial( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.SecuritySetting, JSON, IO[bytes]], - security_settings_name: str = "default", + log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -11176,16 +5492,15 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(log_collection_request, (IOBase, bytes)): + _content = log_collection_request else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(log_collection_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_security_settings_create_or_update_request( + _request = build_clusters_trigger_log_collection_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -11205,7 +5520,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11218,10 +5533,8 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -11232,138 +5545,126 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_trigger_log_collection( self, resource_group_name: str, cluster_name: str, - resource: _models.SecuritySetting, - security_settings_name: str = "default", + log_collection_request: _models.LogCollectionRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SecuritySetting]: - """Create a security setting. + ) -> LROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_trigger_log_collection( self, resource_group_name: str, cluster_name: str, - resource: JSON, - security_settings_name: str = "default", + log_collection_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SecuritySetting]: - """Create a security setting. + ) -> LROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_trigger_log_collection( self, resource_group_name: str, cluster_name: str, - resource: IO[bytes], - security_settings_name: str = "default", + log_collection_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SecuritySetting]: - """Create a security setting. + ) -> LROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_trigger_log_collection( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.SecuritySetting, JSON, IO[bytes]], - security_settings_name: str = "default", + log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.SecuritySetting]: - """Create a security setting. + ) -> LROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Is one of the following types: SecuritySetting, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting or JSON or IO[bytes] - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :param log_collection_request: Trigger Log Collection Request Payload. Is one of the following + types: LogCollectionRequest, JSON, IO[bytes] Required. + :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._trigger_log_collection_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - resource=resource, - security_settings_name=security_settings_name, + log_collection_request=log_collection_request, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11375,7 +5676,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.SecuritySetting, response.json()) + deserialized = _deserialize(_models.Cluster, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -11393,18 +5694,22 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.SecuritySetting].from_continuation_token( + return LROPoller[_models.Cluster].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.SecuritySetting]( + return LROPoller[_models.Cluster]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any + def _configure_remote_support_initial( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11414,17 +5719,26 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_security_settings_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(remote_support_request, (IOBase, bytes)): + _content = remote_support_request + else: + _content = json.dumps(remote_support_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_configure_remote_support_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -11441,7 +5755,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11465,176 +5779,175 @@ def _delete_initial( return deserialized # type: ignore - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any - ) -> LROPoller[None]: - """Delete a SecuritySetting. + @overload + def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: _models.RemoteSupportRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - security_settings_name=security_settings_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace - def list_by_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> ItemPaged["_models.SecuritySetting"]: - """List SecuritySetting resources by Clusters. + @overload + def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :return: An iterator like instance of SecuritySetting - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.SecuritySetting] + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SecuritySetting]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_security_settings_list_by_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + @overload + def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. - return _request + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SecuritySetting], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + @distributed_trace + def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. - def get_next(next_link=None): - _request = prepare_request(next_link) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Is one of the + following types: RemoteSupportRequest, JSON, IO[bytes] Required. + :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._configure_remote_support_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + remote_support_request=remote_support_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - response = pipeline_response.http_response + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return ItemPaged(get_next, extract_data) + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) -class SkusOperations: +class DeploymentSettingsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`skus` attribute. + :attr:`deployment_settings` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11646,34 +5959,19 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - sku_name: str, - *, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.Sku: - """Get SKU resource details within a offer of HCI Cluster. + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any + ) -> _models.DeploymentSetting: + """Get a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :param sku_name: The name of the SKU available within HCI cluster. Required. - :type sku_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: Sku. The Sku is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Sku + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str + :return: DeploymentSetting. The DeploymentSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.DeploymentSetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11687,16 +5985,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Sku] = kwargs.pop("cls", None) + cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - _request = build_skus_get_request( + _request = build_deployment_settings_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - sku_name=sku_name, subscription_id=self._config.subscription_id, - expand=expand, + deployment_settings_name=deployment_settings_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -11730,166 +6025,21 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Sku, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_offer( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - *, - expand: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.Sku"]: - """List Skus available for a offer within the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :keyword expand: Specify $expand=content,contentVersion to populate additional fields related - to the marketplace offer. Default value is None. - :paramtype expand: str - :return: An iterator like instance of Sku - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Sku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Sku]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_skus_list_by_offer_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Sku], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class UpdateRunsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`update_runs` attribute. - """ + deserialized = _deserialize(_models.DeploymentSetting, response.json()) - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any - ) -> _models.UpdateRun: - """Get the Update run for a specified update. + return deserialized # type: ignore - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], + deployment_settings_name: str = "default", + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -11898,18 +6048,27 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_update_runs_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_deployment_settings_create_or_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, subscription_id=self._config.subscription_id, + deployment_settings_name=deployment_settings_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -11919,19 +6078,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -11939,214 +6097,194 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.UpdateRun, response.json()) + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def put( + def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: _models.UpdateRun, + resource: _models.DeploymentSetting, + deployment_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. + ) -> LROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def put( + def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: JSON, + resource: JSON, + deployment_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. + ) -> LROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: JSON + :param resource: Resource create parameters. Required. + :type resource: JSON + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def put( + def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: IO[bytes], + resource: IO[bytes], + deployment_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. + ) -> LROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: IO[bytes] + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def put( + def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: Union[_models.UpdateRun, JSON, IO[bytes]], + resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], + deployment_settings_name: str = "default", **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. + ) -> LROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Is one of the following - types: UpdateRun, JSON, IO[bytes] Required. - :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or JSON or IO[bytes] - :return: UpdateRun. The UpdateRun is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :param resource: Resource create parameters. Is one of the following types: DeploymentSetting, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting or JSON or IO[bytes] + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str + :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(update_runs_properties, (IOBase, bytes)): - _content = update_runs_properties - else: - _content = json.dumps(update_runs_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_update_runs_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + resource=resource, + deployment_settings_name=deployment_settings_name, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.UpdateRun, response.json()) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DeploymentSetting, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - return deserialized # type: ignore + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DeploymentSetting].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DeploymentSetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12161,12 +6299,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_update_runs_delete_request( + _request = build_deployment_settings_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, subscription_id=self._config.subscription_id, + deployment_settings_name=deployment_settings_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12184,7 +6321,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -12198,9 +6335,7 @@ def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -12212,19 +6347,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any ) -> LROPoller[None]: - """Delete specified Update Run. + """Delete a DeploymentSetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str + :param deployment_settings_name: Name of Deployment Setting. Default value is "default". + :type deployment_settings_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -12240,8 +6373,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, + deployment_settings_name=deployment_settings_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12276,26 +6408,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> ItemPaged["_models.UpdateRun"]: - """List all Update runs for a specified update. + def list_by_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.DeploymentSetting"]: + """List DeploymentSetting resources by Clusters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An iterator like instance of UpdateRun - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.UpdateRun] + :return: An iterator like instance of DeploymentSetting + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.DeploymentSetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.UpdateRun]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DeploymentSetting]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12308,10 +6438,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_update_runs_list_request( + _request = build_deployment_settings_list_by_clusters_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - update_name=update_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12335,7 +6464,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -12349,7 +6481,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.UpdateRun], + List[_models.DeploymentSetting], deserialized.get("value", []), ) if cls: @@ -12378,14 +6510,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class UpdatesOperations: +class EdgeDeviceJobsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`updates` attribute. + :attr:`edge_device_jobs` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -12396,18 +6528,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: - """Get specified Update. + def get( + self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any + ) -> _models.EdgeDeviceJob: + """Get a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: EdgeDeviceJob. The EdgeDeviceJob is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12421,13 +6555,12 @@ def get(self, resource_group_name: str, cluster_name: str, update_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Update] = kwargs.pop("cls", None) + cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) - _request = build_updates_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, + _request = build_edge_device_jobs_get_request( + resource_uri=resource_uri, + jobs_name=jobs_name, + edge_device_name=edge_device_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12461,198 +6594,265 @@ def get(self, resource_group_name: str, cluster_name: str, update_name: str, **k if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Update, response.json()) + deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + def _create_or_update_initial( + self, + resource_uri: str, + jobs_name: str, + resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_device_jobs_create_or_update_request( + resource_uri=resource_uri, + jobs_name=jobs_name, + edge_device_name=edge_device_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @overload - def put( + def begin_create_or_update( self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: _models.Update, + resource_uri: str, + jobs_name: str, + resource: _models.EdgeDeviceJob, + edge_device_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Update: - """Put specified Update. + ) -> LROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: ~azure.mgmt.azurestackhci.models.Update + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def put( + def begin_create_or_update( self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: JSON, + resource_uri: str, + jobs_name: str, + resource: JSON, + edge_device_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Update: - """Put specified Update. + ) -> LROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: JSON + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def put( + def begin_create_or_update( self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: IO[bytes], + resource_uri: str, + jobs_name: str, + resource: IO[bytes], + edge_device_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Update: - """Put specified Update. + ) -> LROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: IO[bytes] + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def put( + def begin_create_or_update( self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: Union[_models.Update, JSON, IO[bytes]], + resource_uri: str, + jobs_name: str, + resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], + edge_device_name: str = "default", **kwargs: Any - ) -> _models.Update: - """Put specified Update. + ) -> LROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Is one of the following types: - Update, JSON, IO[bytes] Required. - :type update_properties: ~azure.mgmt.azurestackhci.models.Update or JSON or IO[bytes] - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.Update + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeDeviceJob, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob or JSON or IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Update] = kwargs.pop("cls", None) + cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_uri=resource_uri, + jobs_name=jobs_name, + resource=resource, + edge_device_name=edge_device_name, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(update_properties, (IOBase, bytes)): - _content = update_properties - else: - _content = json.dumps(update_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_updates_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.Update, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.EdgeDeviceJob].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EdgeDeviceJob]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12667,11 +6867,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_updates_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, + _request = build_edge_device_jobs_delete_request( + resource_uri=resource_uri, + jobs_name=jobs_name, + edge_device_name=edge_device_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12689,7 +6888,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -12703,9 +6902,7 @@ def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -12717,17 +6914,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + self, resource_uri: str, jobs_name: str, edge_device_name: str = "default", **kwargs: Any ) -> LROPoller[None]: - """Delete specified Update. + """Delete a EdgeDeviceJob. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str + :type resource_uri: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -12741,9 +6938,9 @@ def begin_delete( cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, + resource_uri=resource_uri, + jobs_name=jobs_name, + edge_device_name=edge_device_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12778,22 +6975,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.Update"]: - """List all Updates. + def list_by_edge_device( + self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any + ) -> ItemPaged["_models.EdgeDeviceJob"]: + """List EdgeDeviceJob resources by EdgeDevice. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of Update - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Update] + :type resource_uri: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: An iterator like instance of EdgeDeviceJob + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Update]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.EdgeDeviceJob]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12806,10 +7005,9 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_updates_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, + _request = build_edge_device_jobs_list_by_edge_device_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12832,7 +7030,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -12846,7 +7047,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Update], + List[_models.EdgeDeviceJob], deserialized.get("value", []), ) if cls: @@ -12870,13 +7071,41 @@ def get_next(next_link=None): ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class EdgeDevicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`edge_devices` attribute. + """ - return ItemPaged(get_next, extract_data) + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def _post_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> Iterator[bytes]: + @distributed_trace + def get(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> _models.EdgeDevice: + """Get a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: EdgeDevice. The EdgeDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -12888,13 +7117,11 @@ def _post_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) - _request = build_updates_post_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, + _request = build_edge_devices_get_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -12905,18 +7132,19 @@ def _post_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -12924,98 +7152,22 @@ def _post_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EdgeDevice, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def begin_post( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Apply Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._post_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "update_name", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _prepare_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + def _create_or_update_initial( + self, + resource_uri: str, + resource: Union[_models.EdgeDevice, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13025,17 +7177,25 @@ def _prepare_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_updates_prepare_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_devices_create_or_update_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -13052,7 +7212,7 @@ def _prepare_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -13065,8 +7225,10 @@ def _prepare_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -13076,48 +7238,127 @@ def _prepare_initial( return deserialized # type: ignore + @overload + def begin_create_or_update( + self, + resource_uri: str, + resource: _models.EdgeDevice, + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + resource: JSON, + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + resource: IO[bytes], + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "update_name", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_prepare( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Prepare Update. + def begin_create_or_update( + self, + resource_uri: str, + resource: Union[_models.EdgeDevice, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any + ) -> LROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :type resource_uri: str + :param resource: Resource create parameters. Is one of the following types: EdgeDevice, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice or JSON or IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._prepare_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, + raw_result = self._create_or_update_initial( + resource_uri=resource_uri, + resource=resource, + edge_device_name=edge_device_name, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -13126,9 +7367,12 @@ def begin_prepare( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeDevice, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -13143,52 +7387,17 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.EdgeDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class UpdateSummariesOperationGroupOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`update_summaries_operation_group` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return LROPoller[_models.EdgeDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "content_type", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _check_updates_initial( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CheckUpdatesRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + def _delete_initial(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -13197,26 +7406,15 @@ def _check_updates_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_update_summaries_operation_group_check_updates_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, + _request = build_edge_devices_delete_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -13257,136 +7455,30 @@ def _check_updates_initial( return deserialized # type: ignore - @overload - def begin_check_updates( - self, - resource_group_name: str, - cluster_name: str, - body: _models.CheckUpdatesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Check for updates. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.azurestackhci.models.CheckUpdatesRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_check_updates( - self, - resource_group_name: str, - cluster_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Check for updates. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_check_updates( - self, - resource_group_name: str, - cluster_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Check for updates. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "content_type", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_check_updates( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CheckUpdatesRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Check for updates. + def begin_delete(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> LROPoller[None]: + """Delete a EdgeDevice. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param body: The content of the action request. Is one of the following types: - CheckUpdatesRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.azurestackhci.models.CheckUpdatesRequest or JSON or IO[bytes] + :type resource_uri: str + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._check_updates_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - body=body, - content_type=content_type, + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -13420,14 +7512,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _check_health_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + @distributed_trace + def list(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.EdgeDevice"]: + """List EdgeDevice resources by parent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :return: An iterator like instance of EdgeDevice + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeDevice]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -13436,16 +7536,112 @@ def _check_health_initial(self, resource_group_name: str, cluster_name: str, **k } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_devices_list_request( + resource_uri=resource_uri, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.EdgeDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _validate_initial( + self, + resource_uri: str, + validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_update_summaries_operation_group_check_health_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _content = None + if isinstance(validate_request, (IOBase, bytes)): + _content = validate_request + else: + _content = json.dumps(validate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_devices_validate_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -13462,7 +7658,7 @@ def _check_health_initial(self, resource_group_name: str, cluster_name: str, **k response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -13486,37 +7682,127 @@ def _check_health_initial(self, resource_group_name: str, cluster_name: str, **k return deserialized # type: ignore + @overload + def begin_validate( + self, + resource_uri: str, + validate_request: _models.ValidateRequest, + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param validate_request: The content of the action request. Required. + :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate( + self, + resource_uri: str, + validate_request: JSON, + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param validate_request: The content of the action request. Required. + :type validate_request: JSON + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate( + self, + resource_uri: str, + validate_request: IO[bytes], + edge_device_name: str = "default", + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param validate_request: The content of the action request. Required. + :type validate_request: IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_check_health(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Check health of UpdateSummaries. + def begin_validate( + self, + resource_uri: str, + validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], + edge_device_name: str = "default", + **kwargs: Any + ) -> LROPoller[_models.ValidateResponse]: + """A long-running resource action. - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :type resource_uri: str + :param validate_request: The content of the action request. Is one of the following types: + ValidateRequest, JSON, IO[bytes] Required. + :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest or JSON or IO[bytes] + :param edge_device_name: Name of Device. Default value is "default". + :type edge_device_name: str + :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateResponse] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._check_health_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, + raw_result = self._validate_initial( + resource_uri=resource_uri, + validate_request=validate_request, + edge_device_name=edge_device_name, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -13525,9 +7811,12 @@ def begin_check_health(self, resource_group_name: str, cluster_name: str, **kwar raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ValidateResponse, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -13542,205 +7831,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.ValidateResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ValidatedSolutionRecipesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`validated_solution_recipes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, location: str, validated_solution_recipe_name: str, **kwargs: Any) -> _models.ValidatedSolutionRecipe: - """Get a validated solution recipe. - - :param location: The name of the Azure region. Required. - :type location: str - :param validated_solution_recipe_name: The name of the ValidatedSolutionRecipe. Required. - :type validated_solution_recipe_name: str - :return: ValidatedSolutionRecipe. The ValidatedSolutionRecipe is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.ValidatedSolutionRecipe] = kwargs.pop("cls", None) - - _request = build_validated_solution_recipes_get_request( - location=location, - validated_solution_recipe_name=validated_solution_recipe_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + return LROPoller[_models.ValidateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ValidatedSolutionRecipe, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_subscription_location_resource( - self, location: str, **kwargs: Any - ) -> ItemPaged["_models.ValidatedSolutionRecipe"]: - """List all validated solution recipes. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of ValidatedSolutionRecipe - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ValidatedSolutionRecipe]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_validated_solution_recipes_list_by_subscription_location_resource_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ValidatedSolutionRecipe], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - -class EdgeMachinesOperations: +class ExtensionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`edge_machines` attribute. + :attr:`extensions` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -13751,29 +7860,23 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def get(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) -> _models.EdgeMachine: - """Get an edge machine. + def get( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> _models.Extension: + """Get particular Arc Extension of HCI Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :return: EdgeMachine. The EdgeMachine is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.EdgeMachine + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :return: Extension. The Extension is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Extension :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13787,11 +7890,13 @@ def get(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - _request = build_edge_machines_get_request( + _request = build_extensions_get_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -13826,32 +7931,20 @@ def get(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.EdgeMachine, response.json()) + deserialized = _deserialize(_models.Extension, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _create_or_update_initial( + def _create_initial( self, resource_group_name: str, - edge_machine_name: str, - resource: Union[_models.EdgeMachine, JSON, IO[bytes]], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.Extension, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -13870,14 +7963,16 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(extension, (IOBase, bytes)): + _content = extension else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_edge_machines_create_or_update_request( + _request = build_extensions_create_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -13925,139 +8020,155 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, - edge_machine_name: str, - resource: _models.EdgeMachine, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: _models.Extension, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachine]: - """Create or update an edge machine. + ) -> LROPoller[_models.Extension]: + """Create Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachine + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: ~azure.mgmt.azurestackhci.models.Extension :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + :return: An instance of LROPoller that returns Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, - edge_machine_name: str, - resource: JSON, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachine]: - """Create or update an edge machine. + ) -> LROPoller[_models.Extension]: + """Create Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + :return: An instance of LROPoller that returns Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create( self, resource_group_name: str, - edge_machine_name: str, - resource: IO[bytes], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachine]: - """Create or update an edge machine. + ) -> LROPoller[_models.Extension]: + """Create Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + :return: An instance of LROPoller that returns Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_create_or_update( + def begin_create( self, resource_group_name: str, - edge_machine_name: str, - resource: Union[_models.EdgeMachine, JSON, IO[bytes]], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.Extension, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.EdgeMachine]: - """Create or update an edge machine. + ) -> LROPoller[_models.Extension]: + """Create Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param resource: Resource create parameters. Is one of the following types: EdgeMachine, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachine or JSON or IO[bytes] - :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Is one of the following + types: Extension, JSON, IO[bytes] Required. + :type extension: ~azure.mgmt.azurestackhci.models.Extension or JSON or IO[bytes] + :return: An instance of LROPoller that returns Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._create_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - resource=resource, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -14069,7 +8180,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeMachine, response.json()) + deserialized = _deserialize(_models.Extension, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -14087,35 +8198,23 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.EdgeMachine].from_continuation_token( + return LROPoller[_models.Extension].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.EdgeMachine]( + return LROPoller[_models.Extension]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) def _update_initial( self, resource_group_name: str, - edge_machine_name: str, - properties: Union[_models.EdgeMachinePatch, JSON, IO[bytes]], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -14134,14 +8233,16 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(extension, (IOBase, bytes)): + _content = extension else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_edge_machines_update_request( + _request = build_extensions_update_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -14176,7 +8277,9 @@ def _update_initial( response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -14190,27 +8293,34 @@ def _update_initial( def begin_update( self, resource_group_name: str, - edge_machine_name: str, - properties: _models.EdgeMachinePatch, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: _models.ExtensionPatch, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachine]: - """Update an edge machine. + ) -> LROPoller[_models.Extension]: + """Update Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.azurestackhci.models.EdgeMachinePatch + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + :return: An instance of LROPoller that returns Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -14218,27 +8328,34 @@ def begin_update( def begin_update( self, resource_group_name: str, - edge_machine_name: str, - properties: JSON, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachine]: - """Update an edge machine. + ) -> LROPoller[_models.Extension]: + """Update Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + :return: An instance of LROPoller that returns Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -14246,80 +8363,82 @@ def begin_update( def begin_update( self, resource_group_name: str, - edge_machine_name: str, - properties: IO[bytes], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachine]: - """Update an edge machine. + ) -> LROPoller[_models.Extension]: + """Update Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + :return: An instance of LROPoller that returns Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) def begin_update( self, resource_group_name: str, - edge_machine_name: str, - properties: Union[_models.EdgeMachinePatch, JSON, IO[bytes]], + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.EdgeMachine]: - """Update an edge machine. + ) -> LROPoller[_models.Extension]: + """Update Extension for HCI cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param properties: The resource properties to be updated. Is one of the following types: - EdgeMachinePatch, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.azurestackhci.models.EdgeMachinePatch or JSON or IO[bytes] - :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Is one of the following + types: ExtensionPatch, JSON, IO[bytes] Required. + :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns Extension. The Extension is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - properties=properties, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -14331,7 +8450,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeMachine, response.json()) + deserialized = _deserialize(_models.Extension, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -14349,24 +8468,19 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.EdgeMachine].from_continuation_token( + return LROPoller[_models.Extension].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.EdgeMachine]( + return LROPoller[_models.Extension]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "edge_machine_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _delete_initial(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) -> Iterator[bytes]: + def _delete_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -14380,9 +8494,11 @@ def _delete_initial(self, resource_group_name: str, edge_machine_name: str, **kw cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_edge_machines_delete_request( + _request = build_extensions_delete_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -14401,7 +8517,7 @@ def _delete_initial(self, resource_group_name: str, edge_machine_name: str, **kw response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -14415,6 +8531,9 @@ def _delete_initial(self, resource_group_name: str, edge_machine_name: str, **kw response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -14426,21 +8545,21 @@ def _delete_initial(self, resource_group_name: str, edge_machine_name: str, **kw return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "edge_machine_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_delete(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete an edge machine. + def begin_delete( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete particular Arc Extension of HCI Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -14455,7 +8574,9 @@ def begin_delete(self, resource_group_name: str, edge_machine_name: str, **kwarg if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -14490,25 +8611,27 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.EdgeMachine"]: - """List all edge machines in a resource group. + def list_by_arc_setting( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> ItemPaged["_models.Extension"]: + """List all Extensions under ArcSetting resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :return: An iterator like instance of EdgeMachine - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachine] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An iterator like instance of Extension + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Extension] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EdgeMachine]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Extension]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14521,8 +8644,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite def prepare_request(next_link=None): if not next_link: - _request = build_edge_machines_list_by_resource_group_request( + _request = build_extensions_list_by_arc_setting_request( resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -14546,7 +8671,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -14560,7 +8688,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.EdgeMachine], + List[_models.Extension], deserialized.get("value", []), ) if cls: @@ -14588,24 +8716,15 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=["2026-04-01-preview"], - ) - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.EdgeMachine"]: - """List all edge machines in a subscription. - - :return: An iterator like instance of EdgeMachine - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EdgeMachine]] = kwargs.pop("cls", None) - + def _upgrade_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -14614,84 +8733,262 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.EdgeMachine" } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_edge_machines_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(extension_upgrade_parameters, (IOBase, bytes)): + _content = extension_upgrade_parameters + else: + _content = json.dumps(extension_upgrade_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_extensions_upgrade_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EdgeMachine], - deserialized.get("value", []), + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: _models.ExtensionUpgradeParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. - def get_next(next_link=None): - _request = prepare_request(next_link) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Is one of the following types: ExtensionUpgradeParameters, JSON, IO[bytes] Required. + :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._upgrade_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension_upgrade_parameters=extension_upgrade_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - response = pipeline_response.http_response + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return ItemPaged(get_next, extract_data) + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class EdgeMachineJobsOperations: +class SecuritySettingsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`edge_machine_jobs` attribute. + :attr:`security_settings` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -14702,34 +8999,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) def get( - self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any - ) -> _models.EdgeMachineJob: - """Get a EdgeMachineJob. + self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any + ) -> _models.SecuritySetting: + """Get a SecuritySetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str - :return: EdgeMachineJob. The EdgeMachineJob is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.EdgeMachineJob + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str + :return: SecuritySetting. The SecuritySetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.SecuritySetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14743,13 +9026,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.EdgeMachineJob] = kwargs.pop("cls", None) + cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) - _request = build_edge_machine_jobs_get_request( + _request = build_security_settings_get_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, + security_settings_name=security_settings_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -14783,34 +9066,19 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.EdgeMachineJob, response.json()) + deserialized = _deserialize(_models.SecuritySetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) def _create_or_update_initial( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, - resource: Union[_models.EdgeMachineJob, JSON, IO[bytes]], + cluster_name: str, + resource: Union[_models.SecuritySetting, JSON, IO[bytes]], + security_settings_name: str = "default", **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -14834,11 +9102,11 @@ def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_edge_machine_jobs_create_or_update_request( + _request = build_security_settings_create_or_update_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, + security_settings_name=security_settings_name, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -14888,30 +9156,30 @@ def _create_or_update_initial( def begin_create_or_update( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, - resource: _models.EdgeMachineJob, + cluster_name: str, + resource: _models.SecuritySetting, + security_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachineJob]: - """Create a EdgeMachineJob. + ) -> LROPoller[_models.SecuritySetting]: + """Create a security setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachineJob + :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachineJob. The EdgeMachineJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -14919,30 +9187,30 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, + cluster_name: str, resource: JSON, + security_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachineJob]: - """Create a EdgeMachineJob. + ) -> LROPoller[_models.SecuritySetting]: + """Create a security setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param resource: Resource create parameters. Required. :type resource: JSON + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachineJob. The EdgeMachineJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -14950,88 +9218,73 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, + cluster_name: str, resource: IO[bytes], + security_settings_name: str = "default", *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.EdgeMachineJob]: - """Create a EdgeMachineJob. + ) -> LROPoller[_models.SecuritySetting]: + """Create a security setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns EdgeMachineJob. The EdgeMachineJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) def begin_create_or_update( self, resource_group_name: str, - edge_machine_name: str, - jobs_name: str, - resource: Union[_models.EdgeMachineJob, JSON, IO[bytes]], + cluster_name: str, + resource: Union[_models.SecuritySetting, JSON, IO[bytes]], + security_settings_name: str = "default", **kwargs: Any - ) -> LROPoller[_models.EdgeMachineJob]: - """Create a EdgeMachineJob. + ) -> LROPoller[_models.SecuritySetting]: + """Create a security setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Is one of the following types: EdgeMachineJob, + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param resource: Resource create parameters. Is one of the following types: SecuritySetting, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachineJob or JSON or IO[bytes] - :return: An instance of LROPoller that returns EdgeMachineJob. The EdgeMachineJob is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting or JSON or IO[bytes] + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str + :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeMachineJob] = kwargs.pop("cls", None) + cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, resource=resource, + security_settings_name=security_settings_name, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -15043,7 +9296,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.EdgeMachineJob, response.json()) + deserialized = _deserialize(_models.SecuritySetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -15061,31 +9314,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.EdgeMachineJob].from_continuation_token( + return LROPoller[_models.SecuritySetting].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.EdgeMachineJob]( + return LROPoller[_models.SecuritySetting]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) def _delete_initial( - self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15100,11 +9340,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_edge_machine_jobs_delete_request( + _request = build_security_settings_delete_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, + security_settings_name=security_settings_name, api_version=self._config.api_version, headers=_headers, params=_params, @@ -15147,31 +9387,18 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "jobs_name", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) def begin_delete( - self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any ) -> LROPoller[None]: - """Delete a EdgeMachineJob. + """Delete a SecuritySetting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :param jobs_name: Name of EdgeMachineJob. Required. - :type jobs_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Default value is "default". + :type security_settings_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -15186,8 +9413,8 @@ def begin_delete( if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, - jobs_name=jobs_name, + cluster_name=cluster_name, + security_settings_name=security_settings_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -15222,37 +9449,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "edge_machine_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def list( - self, resource_group_name: str, edge_machine_name: str, **kwargs: Any - ) -> ItemPaged["_models.EdgeMachineJob"]: - """List EdgeMachineJob resources by EdgeMachines. + def list_by_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.SecuritySetting"]: + """List SecuritySetting resources by Clusters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param edge_machine_name: Name of Device. Required. - :type edge_machine_name: str - :return: An iterator like instance of EdgeMachineJob - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of SecuritySetting + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.SecuritySetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.EdgeMachineJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SecuritySetting]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15265,9 +9479,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_edge_machine_jobs_list_request( + _request = build_security_settings_list_by_clusters_request( resource_group_name=resource_group_name, - edge_machine_name=edge_machine_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15291,7 +9505,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -15305,7 +9522,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.EdgeMachineJob], + List[_models.SecuritySetting], deserialized.get("value", []), ) if cls: @@ -15334,14 +9551,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class OwnershipVouchersOperations: +class SkusOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`ownership_vouchers` attribute. + :attr:`skus` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -15351,126 +9568,36 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @overload - def validate( - self, - resource_group_name: str, - location: str, - validation_request: _models.ValidateOwnershipVouchersRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidateOwnershipVouchersResponse: - """Validates ownership vouchers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param validation_request: Ownership vouchers to be validated. Required. - :type validation_request: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible - with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate( - self, - resource_group_name: str, - location: str, - validation_request: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidateOwnershipVouchersResponse: - """Validates ownership vouchers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param validation_request: Ownership vouchers to be validated. Required. - :type validation_request: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible - with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def validate( - self, - resource_group_name: str, - location: str, - validation_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ValidateOwnershipVouchersResponse: - """Validates ownership vouchers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param validation_request: Ownership vouchers to be validated. Required. - :type validation_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible - with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "location", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def validate( + def get( self, resource_group_name: str, - location: str, - validation_request: Union[_models.ValidateOwnershipVouchersRequest, JSON, IO[bytes]], + cluster_name: str, + publisher_name: str, + offer_name: str, + sku_name: str, + *, + expand: Optional[str] = None, **kwargs: Any - ) -> _models.ValidateOwnershipVouchersResponse: - """Validates ownership vouchers. + ) -> _models.Sku: + """Get SKU resource details within a offer of HCI Cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param location: The name of the Azure region. Required. - :type location: str - :param validation_request: Ownership vouchers to be validated. Is one of the following types: - ValidateOwnershipVouchersRequest, JSON, IO[bytes] Required. - :type validation_request: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest or - JSON or IO[bytes] - :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible - with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :param sku_name: The name of the SKU available within HCI cluster. Required. + :type sku_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: Sku. The Sku is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Sku :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -15481,26 +9608,20 @@ def validate( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateOwnershipVouchersResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(validation_request, (IOBase, bytes)): - _content = validation_request - else: - _content = json.dumps(validation_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Sku] = kwargs.pop("cls", None) - _request = build_ownership_vouchers_validate_request( + _request = build_skus_get_request( resource_group_name=resource_group_name, - location=location, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + sku_name=sku_name, subscription_id=self._config.subscription_id, - content_type=content_type, + expand=expand, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -15533,22 +9654,141 @@ def validate( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ValidateOwnershipVouchersResponse, response.json()) + deserialized = _deserialize(_models.Sku, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @distributed_trace + def list_by_offer( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.Sku"]: + """List Skus available for a offer within the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Sku + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Sku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Sku]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_skus_list_by_offer_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Sku], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + -class ClusterJobsOperations: +class UpdateRunsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`cluster_jobs` attribute. + :attr:`update_runs` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -15559,32 +9799,22 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "jobs_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def get(self, resource_group_name: str, cluster_name: str, jobs_name: str, **kwargs: Any) -> _models.ClusterJob: - """Get a ClusterJob. + def get( + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + ) -> _models.UpdateRun: + """Get the Update run for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :return: ClusterJob. The ClusterJob is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.ClusterJob + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -15598,12 +9828,13 @@ def get(self, resource_group_name: str, cluster_name: str, jobs_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ClusterJob] = kwargs.pop("cls", None) + cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - _request = build_cluster_jobs_get_request( + _request = build_update_runs_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - jobs_name=jobs_name, + update_name=update_name, + update_run_name=update_run_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15638,303 +9869,211 @@ def get(self, resource_group_name: str, cluster_name: str, jobs_name: str, **kwa if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ClusterJob, response.json()) + deserialized = _deserialize(_models.UpdateRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "jobs_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - jobs_name: str, - resource: Union[_models.ClusterJob, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_cluster_jobs_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - jobs_name=jobs_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @overload - def begin_create_or_update( + def put( self, resource_group_name: str, cluster_name: str, - jobs_name: str, - resource: _models.ClusterJob, + update_name: str, + update_run_name: str, + update_runs_properties: _models.UpdateRun, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ClusterJob]: - """Create a ClusterJob. + ) -> _models.UpdateRun: + """Put Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.ClusterJob + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ClusterJob. The ClusterJob is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterJob] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def put( self, resource_group_name: str, cluster_name: str, - jobs_name: str, - resource: JSON, + update_name: str, + update_run_name: str, + update_runs_properties: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ClusterJob]: - """Create a ClusterJob. + ) -> _models.UpdateRun: + """Put Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ClusterJob. The ClusterJob is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterJob] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def put( self, resource_group_name: str, cluster_name: str, - jobs_name: str, - resource: IO[bytes], + update_name: str, + update_run_name: str, + update_runs_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ClusterJob]: - """Create a ClusterJob. + ) -> _models.UpdateRun: + """Put Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns ClusterJob. The ClusterJob is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterJob] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "cluster_name", - "jobs_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_create_or_update( + def put( self, resource_group_name: str, cluster_name: str, - jobs_name: str, - resource: Union[_models.ClusterJob, JSON, IO[bytes]], + update_name: str, + update_run_name: str, + update_runs_properties: Union[_models.UpdateRun, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ClusterJob]: - """Create a ClusterJob. + ) -> _models.UpdateRun: + """Put Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str - :param resource: Resource create parameters. Is one of the following types: ClusterJob, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.ClusterJob or JSON or IO[bytes] - :return: An instance of LROPoller that returns ClusterJob. The ClusterJob is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterJob] + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Is one of the following + types: UpdateRun, JSON, IO[bytes] Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or JSON or IO[bytes] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ClusterJob] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - jobs_name=jobs_name, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ClusterJob, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(update_runs_properties, (IOBase, bytes)): + _content = update_runs_properties + else: + _content = json.dumps(update_runs_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_update_runs_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.ClusterJob].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClusterJob]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.UpdateRun, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "jobs_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) def _delete_initial( - self, resource_group_name: str, cluster_name: str, jobs_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15949,10 +10088,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_cluster_jobs_delete_request( + _request = build_update_runs_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - jobs_name=jobs_name, + update_name=update_name, + update_run_name=update_run_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15971,7 +10111,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -15985,7 +10125,9 @@ def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -15996,25 +10138,20 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "jobs_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) def begin_delete( - self, resource_group_name: str, cluster_name: str, jobs_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a ClusterJob. + """Delete specified Update Run. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :param jobs_name: Name of ClusterJob. Required. - :type jobs_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -16030,7 +10167,8 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - jobs_name=jobs_name, + update_name=update_name, + update_run_name=update_run_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -16065,29 +10203,26 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.ClusterJob"]: - """List ClusterJob resources by Clusters. + def list( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> ItemPaged["_models.UpdateRun"]: + """List all Update runs for a specified update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param cluster_name: The name of the cluster. Required. :type cluster_name: str - :return: An iterator like instance of ClusterJob - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ClusterJob] + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An iterator like instance of UpdateRun + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.UpdateRun] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ClusterJob]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.UpdateRun]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -16100,9 +10235,10 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_cluster_jobs_list_request( + _request = build_update_runs_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, + update_name=update_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -16126,7 +10262,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -16140,7 +10279,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ClusterJob], + List[_models.UpdateRun], deserialized.get("value", []), ) if cls: @@ -16169,14 +10308,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class DevicePoolsOperations: +class UpdatesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`device_pools` attribute. + :attr:`updates` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -16187,29 +10326,18 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def get(self, resource_group_name: str, device_pool_name: str, **kwargs: Any) -> _models.DevicePool: - """Get a DevicePool. + def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: + """Get specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :return: DevicePool. The DevicePool is compatible with MutableMapping - :rtype: ~azure.mgmt.azurestackhci.models.DevicePool + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -16223,11 +10351,12 @@ def get(self, resource_group_name: str, device_pool_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DevicePool] = kwargs.pop("cls", None) + cls: ClsType[_models.Update] = kwargs.pop("cls", None) - _request = build_device_pools_get_request( + _request = build_updates_get_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, + update_name=update_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -16262,285 +10391,199 @@ def get(self, resource_group_name: str, device_pool_name: str, **kwargs: Any) -> if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DevicePool, response.json()) + deserialized = _deserialize(_models.Update, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - device_pool_name: str, - resource: Union[_models.DevicePool, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_device_pools_create_or_update_request( - resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - @overload - def begin_create_or_update( + def put( self, resource_group_name: str, - device_pool_name: str, - resource: _models.DevicePool, + cluster_name: str, + update_name: str, + update_properties: _models.Update, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.DevicePool]: - """Create a DevicePool. + ) -> _models.Update: + """Put specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.DevicePool + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns DevicePool. The DevicePool is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def put( self, resource_group_name: str, - device_pool_name: str, - resource: JSON, + cluster_name: str, + update_name: str, + update_properties: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.DevicePool]: - """Create a DevicePool. + ) -> _models.Update: + """Put specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns DevicePool. The DevicePool is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def put( self, resource_group_name: str, - device_pool_name: str, - resource: IO[bytes], + cluster_name: str, + update_name: str, + update_properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.DevicePool]: - """Create a DevicePool. + ) -> _models.Update: + """Put specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DevicePool. The DevicePool is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DevicePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_create_or_update( + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def put( self, resource_group_name: str, - device_pool_name: str, - resource: Union[_models.DevicePool, JSON, IO[bytes]], + cluster_name: str, + update_name: str, + update_properties: Union[_models.Update, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.DevicePool]: - """Create a DevicePool. + ) -> _models.Update: + """Put specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param resource: Resource create parameters. Is one of the following types: DevicePool, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.azurestackhci.models.DevicePool or JSON or IO[bytes] - :return: An instance of LROPoller that returns DevicePool. The DevicePool is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Is one of the following types: + Update, JSON, IO[bytes] Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update or JSON or IO[bytes] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DevicePool] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.Update] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DevicePool, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(update_properties, (IOBase, bytes)): + _content = update_properties + else: + _content = json.dumps(update_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_updates_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.DevicePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DevicePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.Update, response.json()) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "device_pool_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _delete_initial(self, resource_group_name: str, device_pool_name: str, **kwargs: Any) -> Iterator[bytes]: + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -16554,9 +10597,10 @@ def _delete_initial(self, resource_group_name: str, device_pool_name: str, **kwa cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_device_pools_delete_request( + _request = build_updates_delete_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, + update_name=update_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -16575,7 +10619,7 @@ def _delete_initial(self, resource_group_name: str, device_pool_name: str, **kwa response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -16589,7 +10633,9 @@ def _delete_initial(self, resource_group_name: str, device_pool_name: str, **kwa response_headers = {} if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -16600,21 +10646,18 @@ def _delete_initial(self, resource_group_name: str, device_pool_name: str, **kwa return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "device_pool_name"] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_delete(self, resource_group_name: str, device_pool_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a DevicePool. + def begin_delete( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete specified Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -16629,7 +10672,8 @@ def begin_delete(self, resource_group_name: str, device_pool_name: str, **kwargs if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, + update_name=update_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -16642,47 +10686,129 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) # type: ignore - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.Update"]: + """List all Updates. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Update + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Update] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Update]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_updates_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Update], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return ItemPaged(get_next, extract_data) - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def _update_initial( - self, - resource_group_name: str, - device_pool_name: str, - properties: Union[_models.DevicePoolPatch, JSON, IO[bytes]], - **kwargs: Any + def _post_initial( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -16692,26 +10818,17 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_device_pools_update_request( + _request = build_updates_post_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, + update_name=update_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -16742,6 +10859,9 @@ def _update_initial( response_headers = {} if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -16752,141 +10872,35 @@ def _update_initial( return deserialized # type: ignore - @overload - def begin_update( - self, - resource_group_name: str, - device_pool_name: str, - properties: _models.DevicePoolPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DevicePool]: - """Update a devicePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.azurestackhci.models.DevicePoolPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DevicePool. The DevicePool is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DevicePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - device_pool_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DevicePool]: - """Update a devicePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DevicePool. The DevicePool is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DevicePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - device_pool_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DevicePool]: - """Update a devicePool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns DevicePool. The DevicePool is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DevicePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - @api_version_validation( - method_added_on="2026-04-01-preview", - params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-04-01-preview"], - ) - def begin_update( - self, - resource_group_name: str, - device_pool_name: str, - properties: Union[_models.DevicePoolPatch, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DevicePool]: - """Update a devicePool. + def begin_post( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Apply Update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param properties: The resource properties to be updated. Is one of the following types: - DevicePoolPatch, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.azurestackhci.models.DevicePoolPatch or JSON or IO[bytes] - :return: An instance of LROPoller that returns DevicePool. The DevicePool is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DevicePool] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DevicePool] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._post_initial( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - properties=properties, - content_type=content_type, + cluster_name=cluster_name, + update_name=update_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -16895,12 +10909,9 @@ def begin_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.DevicePool, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -16915,37 +10926,30 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.DevicePool].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.DevicePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace @api_version_validation( method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=["2026-04-01-preview"], + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "update_name", + ] + }, + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.DevicePool"]: - """List all device pools in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of DevicePool - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.DevicePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DevicePool]] = kwargs.pop("cls", None) - + def _prepare_initial( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -16954,170 +10958,149 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_device_pools_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - return _request + _request = build_updates_prepare_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DevicePool], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - return pipeline_response + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace @api_version_validation( method_added_on="2026-04-01-preview", - params_added_on={"2026-04-01-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=["2026-04-01-preview"], + params_added_on={ + "2026-04-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "update_name", + ] + }, + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.DevicePool"]: - """List all device pools in a subscription. + def begin_prepare( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Prepare Update. - :return: An iterator like instance of DevicePool - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.DevicePool] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DevicePool]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_device_pools_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DevicePool], - deserialized.get("value", []), + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._prepare_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - response = pipeline_response.http_response + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response +class UpdateSummariesOperationGroupOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - return ItemPaged(get_next, extract_data) + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`update_summaries_operation_group` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @api_version_validation( method_added_on="2026-04-01-preview", @@ -17126,17 +11109,17 @@ def get_next(next_link=None): "api_version", "subscription_id", "resource_group_name", - "device_pool_name", + "cluster_name", "content_type", ] }, - api_versions_list=["2026-04-01-preview"], + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - def _claim_devices_initial( + def _check_updates_initial( self, resource_group_name: str, - device_pool_name: str, - body: Union[_models.ClaimDeviceRequest, JSON, IO[bytes]], + cluster_name: str, + body: Union[_models.CheckUpdatesRequest, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -17160,9 +11143,9 @@ def _claim_devices_initial( else: _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_device_pools_claim_devices_request( + _request = build_update_summaries_operation_group_check_updates_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -17208,24 +11191,24 @@ def _claim_devices_initial( return deserialized # type: ignore @overload - def begin_claim_devices( + def begin_check_updates( self, resource_group_name: str, - device_pool_name: str, - body: _models.ClaimDeviceRequest, + cluster_name: str, + body: _models.CheckUpdatesRequest, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Claiming devices of the pool. + """Check for updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param body: The content of the action request. Required. - :type body: ~azure.mgmt.azurestackhci.models.ClaimDeviceRequest + :type body: ~azure.mgmt.azurestackhci.models.CheckUpdatesRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -17235,22 +11218,22 @@ def begin_claim_devices( """ @overload - def begin_claim_devices( + def begin_check_updates( self, resource_group_name: str, - device_pool_name: str, + cluster_name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Claiming devices of the pool. + """Check for updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param body: The content of the action request. Required. :type body: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -17262,22 +11245,22 @@ def begin_claim_devices( """ @overload - def begin_claim_devices( + def begin_check_updates( self, resource_group_name: str, - device_pool_name: str, + cluster_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Claiming devices of the pool. + """Check for updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param body: The content of the action request. Required. :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -17296,29 +11279,29 @@ def begin_claim_devices( "api_version", "subscription_id", "resource_group_name", - "device_pool_name", + "cluster_name", "content_type", ] }, - api_versions_list=["2026-04-01-preview"], + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - def begin_claim_devices( + def begin_check_updates( self, resource_group_name: str, - device_pool_name: str, - body: Union[_models.ClaimDeviceRequest, JSON, IO[bytes]], + cluster_name: str, + body: Union[_models.CheckUpdatesRequest, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: - """Claiming devices of the pool. + """Check for updates. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :param body: The content of the action request. Is one of the following types: - ClaimDeviceRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.azurestackhci.models.ClaimDeviceRequest or JSON or IO[bytes] + CheckUpdatesRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.azurestackhci.models.CheckUpdatesRequest or JSON or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -17332,9 +11315,9 @@ def begin_claim_devices( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._claim_devices_initial( + raw_result = self._check_updates_initial( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, body=body, content_type=content_type, cls=lambda x, y, z: x, @@ -17373,23 +11356,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @api_version_validation( method_added_on="2026-04-01-preview", params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - ] + "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name"] }, - api_versions_list=["2026-04-01-preview"], + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - def _release_devices_initial( - self, - resource_group_name: str, - device_pool_name: str, - body: Union[_models.ReleaseDeviceRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + def _check_health_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -17398,26 +11369,16 @@ def _release_devices_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_device_pools_release_devices_request( + _request = build_update_summaries_operation_group_check_health_request( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -17443,151 +11404,52 @@ def _release_devices_initial( error = _failsafe_deserialize( _models.ErrorResponse, response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_release_devices( - self, - resource_group_name: str, - device_pool_name: str, - body: _models.ReleaseDeviceRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Releasing devices of the pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.azurestackhci.models.ReleaseDeviceRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - @overload - def begin_release_devices( - self, - resource_group_name: str, - device_pool_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Releasing devices of the pool. + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param body: The content of the action request. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - @overload - def begin_release_devices( - self, - resource_group_name: str, - device_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Releasing devices of the pool. + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return deserialized # type: ignore @distributed_trace @api_version_validation( method_added_on="2026-04-01-preview", params_added_on={ - "2026-04-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "device_pool_name", - "content_type", - ] + "2026-04-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name"] }, - api_versions_list=["2026-04-01-preview"], + api_versions_list=["2026-04-01-preview", "2026-04-30"], ) - def begin_release_devices( - self, - resource_group_name: str, - device_pool_name: str, - body: Union[_models.ReleaseDeviceRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Releasing devices of the pool. + def begin_check_health(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Check health of UpdateSummaries. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param device_pool_name: The name of the DevicePool. Required. - :type device_pool_name: str - :param body: The content of the action request. Is one of the following types: - ReleaseDeviceRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.azurestackhci.models.ReleaseDeviceRequest or JSON or IO[bytes] + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._release_devices_initial( + raw_result = self._check_health_initial( resource_group_name=resource_group_name, - device_pool_name=device_pool_name, - body=body, - content_type=content_type, + cluster_name=cluster_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -17622,6 +11484,191 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore +class ValidatedSolutionRecipesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`validated_solution_recipes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, validated_solution_recipe_name: str, **kwargs: Any) -> _models.ValidatedSolutionRecipe: + """Get a validated solution recipe. + + :param location: The name of the Azure region. Required. + :type location: str + :param validated_solution_recipe_name: The name of the ValidatedSolutionRecipe. Required. + :type validated_solution_recipe_name: str + :return: ValidatedSolutionRecipe. The ValidatedSolutionRecipe is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidatedSolutionRecipe] = kwargs.pop("cls", None) + + _request = build_validated_solution_recipes_get_request( + location=location, + validated_solution_recipe_name=validated_solution_recipe_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ValidatedSolutionRecipe, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription_location_resource( + self, location: str, **kwargs: Any + ) -> ItemPaged["_models.ValidatedSolutionRecipe"]: + """List all validated solution recipes. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of ValidatedSolutionRecipe + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ValidatedSolutionRecipe]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_validated_solution_recipes_list_by_subscription_location_resource_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ValidatedSolutionRecipe], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + class UpdateSummariesOperations: """ .. warning:: @@ -18053,7 +12100,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/change_cluster_ring.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/change_cluster_ring.py deleted file mode 100644 index 1d9a175554cb..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/change_cluster_ring.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python change_cluster_ring.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.clusters.begin_change_ring( - resource_group_name="test-rg", - cluster_name="myCluster", - change_ring_request={"properties": {"targetRing": "Insider"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/ChangeClusterRing.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_create_or_update_configure_cvm.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_create_or_update_configure_cvm.py deleted file mode 100644 index e0a14345edaf..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_create_or_update_configure_cvm.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python cluster_jobs_create_or_update_configure_cvm.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cluster_jobs.begin_create_or_update( - resource_group_name="test-rg", - cluster_name="myCluster", - jobs_name="ConfigureCVM", - resource={ - "properties": {"confidentialVmIntent": "Enable", "deploymentMode": "Deploy", "jobType": "ConfigureCVM"} - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/ClusterJobs_CreateOrUpdate_ConfigureCVM.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_create_or_update_configure_sdn_integration_enable.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_create_or_update_configure_sdn_integration_enable.py deleted file mode 100644 index 03a576fff2a3..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_create_or_update_configure_sdn_integration_enable.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python cluster_jobs_create_or_update_configure_sdn_integration_enable.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cluster_jobs.begin_create_or_update( - resource_group_name="test-rg", - cluster_name="myCluster", - jobs_name="configureSdnIntegration", - resource={ - "properties": { - "deploymentMode": "Deploy", - "jobType": "ConfigureSdnIntegration", - "sdnIntegrationIntent": "Enable", - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/ClusterJobs_CreateOrUpdate_ConfigureSdnIntegration_Enable.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_delete.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_delete.py deleted file mode 100644 index 1c6a8f7ef91a..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python cluster_jobs_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.cluster_jobs.begin_delete( - resource_group_name="rghci", - cluster_name="3-Vz3LSRO5Q6q8EV-PKs8-5E", - jobs_name="configureSdnIntegration", - ).result() - - -# x-ms-original-file: 2026-04-01-preview/ClusterJobs_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_get_configure_sdn_integration_job.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_get_configure_sdn_integration_job.py deleted file mode 100644 index 7a5187b709f9..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_get_configure_sdn_integration_job.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python cluster_jobs_get_configure_sdn_integration_job.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cluster_jobs.get( - resource_group_name="rghci", - cluster_name="Y-k0MG", - jobs_name="configureSdnIntegration", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/ClusterJobs_Get_ConfigureSdnIntegrationJob.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_list.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_list.py deleted file mode 100644 index 4dc06e2ac400..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/cluster_jobs_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python cluster_jobs_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cluster_jobs.list( - resource_group_name="rghci", - cluster_name="Ql40O4-I77S", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/ClusterJobs_List.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/clusters_update_secrets_locations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/clusters_update_secrets_locations.py index d9e84722e937..2db677ef78cf 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/clusters_update_secrets_locations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/clusters_update_secrets_locations.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/Clusters_UpdateSecretsLocations.json +# x-ms-original-file: 2026-04-30/Clusters_UpdateSecretsLocations.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py index 554dbab646d6..618278be1728 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/ConfigureRemoteSupport.json +# x-ms-original-file: 2026-04-30/ConfigureRemoteSupport.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py index 76d91ff791a6..1bd43e4c18b8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/ConsentAndInstallDefaultExtensions.json +# x-ms-original-file: 2026-04-30/ConsentAndInstallDefaultExtensions.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py index 503d724879fb..9170d61e7699 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/CreateArcIdentity.json +# x-ms-original-file: 2026-04-30/CreateArcIdentity.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py index f642d4bdcb5f..caaae3965562 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py @@ -35,7 +35,6 @@ def main(): cluster_name="myCluster", cluster={ "identity": {"type": "SystemAssigned"}, - "kind": "AzureLocal", "location": "East US", "properties": { "aadClientId": "24a6e53d-04e5-44d2-b7cc-1b732a847dfc", @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/CreateCluster.json +# x-ms-original-file: 2026-04-30/CreateCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py index 4e5b70014dc9..678af7415e23 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/CreateClusterIdentity.json +# x-ms-original-file: 2026-04-30/CreateClusterIdentity.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py index 6cab60790423..50287c32912a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py @@ -58,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/CreateHciEdgeDevice.json +# x-ms-original-file: 2026-04-30/CreateHciEdgeDevice.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py index 22b54d6bc66d..7ba8d2007979 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteArcSetting.json +# x-ms-original-file: 2026-04-30/DeleteArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py index f817c6f8de97..04bb6cd4dec0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteCluster.json +# x-ms-original-file: 2026-04-30/DeleteCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py index 1957f7ab34ed..164510d589ae 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteDeploymentSettings.json +# x-ms-original-file: 2026-04-30/DeleteDeploymentSettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_edge_devices.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_edge_devices.py index faa4e5cb7714..f389372001ec 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_edge_devices.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_edge_devices.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteEdgeDevices.json +# x-ms-original-file: 2026-04-30/DeleteEdgeDevices.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py index fe824adf0822..9cadaf554d84 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteExtension.json +# x-ms-original-file: 2026-04-30/DeleteExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py index c97d6e4be43a..0d1b9b71ff8d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteSecuritySettings.json +# x-ms-original-file: 2026-04-30/DeleteSecuritySettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py index f16e500b41af..29d12056ba13 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteUpdateRuns.json +# x-ms-original-file: 2026-04-30/DeleteUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py index 081c1a9a0d76..463fe860d0df 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteUpdateSummaries.json +# x-ms-original-file: 2026-04-30/DeleteUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py index 83ef5ee45a4d..85fdfb652f7c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/DeleteUpdates.json +# x-ms-original-file: 2026-04-30/DeleteUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_claim_devices_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_claim_devices_maximum_set_gen.py deleted file mode 100644 index 8bc8fd89521b..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_claim_devices_maximum_set_gen.py +++ /dev/null @@ -1,48 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_claim_devices_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.device_pools.begin_claim_devices( - resource_group_name="ArcInstance-rg", - device_pool_name="ptfebvgxxqllx", - body={ - "claimedBy": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.AzureStackHCI/clusters/cluster1", - "devices": [ - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.AzureStackHCI/edgeMachines/machine-1" - ], - }, - ).result() - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_ClaimDevices_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_create_or_update.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_create_or_update.py deleted file mode 100644 index 6e4b790e783e..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_create_or_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.device_pools.begin_create_or_update( - resource_group_name="ArcInstance-rg", - device_pool_name="devicePool-1", - resource={"location": "eastus", "properties": {}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_create_or_update_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_create_or_update_maximum_set_gen.py deleted file mode 100644 index a6c6a96faf43..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_create_or_update_maximum_set_gen.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_create_or_update_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.device_pools.begin_create_or_update( - resource_group_name="ArcInstance-rg", - device_pool_name="devicePool1", - resource={"location": "eastus", "properties": {}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_CreateOrUpdate_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_delete_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_delete_maximum_set_gen.py deleted file mode 100644 index 4ad72c96f126..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_delete_maximum_set_gen.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_delete_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.device_pools.begin_delete( - resource_group_name="ArcInstance-rg", - device_pool_name="devicePool1", - ).result() - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_Delete_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_delete_minimum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_delete_minimum_set_gen.py deleted file mode 100644 index c10e71fdf238..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_delete_minimum_set_gen.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_delete_minimum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.device_pools.begin_delete( - resource_group_name="ArcInstance-rg", - device_pool_name="devicePool1", - ).result() - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_Delete_MinimumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_get_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_get_maximum_set_gen.py deleted file mode 100644 index dd6002b24e54..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_get_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_get_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.device_pools.get( - resource_group_name="ArcInstance-rg", - device_pool_name="fflisdaccdcoj", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_Get_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_list_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_list_by_resource_group.py deleted file mode 100644 index 6935538cbf8b..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_list_by_resource_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_list_by_resource_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.device_pools.list_by_resource_group( - resource_group_name="test-rg", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_ListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_list_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_list_by_subscription.py deleted file mode 100644 index 0221182a8f86..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_list_by_subscription.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_list_by_subscription.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.device_pools.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_ListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_release_devices_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_release_devices_maximum_set_gen.py deleted file mode 100644 index 58f04c1330d6..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_release_devices_maximum_set_gen.py +++ /dev/null @@ -1,47 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_release_devices_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.device_pools.begin_release_devices( - resource_group_name="ArcInstance-rg", - device_pool_name="snbyzreoirqiz", - body={ - "devices": [ - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.AzureStackHCI/edgeMachines/machine-1" - ] - }, - ).result() - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_ReleaseDevices_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_update_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_update_maximum_set_gen.py deleted file mode 100644 index 451b3e729aa4..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/device_pools_update_maximum_set_gen.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python device_pools_update_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.device_pools.begin_update( - resource_group_name="ArcInstance-rg", - device_pool_name="devicePool1", - properties={"tags": {"key2335": "beth"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/DevicePools_Update_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_collect_log.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_collect_log.py index 141275ffd1ed..f34268737f20 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_collect_log.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_collect_log.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/EdgeDeviceJobs_CreateOrUpdate_CollectLog.json +# x-ms-original-file: 2026-04-30/EdgeDeviceJobs_CreateOrUpdate_CollectLog.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_remote_support.py index e06b9d162aac..45b2506702bd 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_remote_support.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_remote_support.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/EdgeDeviceJobs_CreateOrUpdate_RemoteSupport.json +# x-ms-original-file: 2026-04-30/EdgeDeviceJobs_CreateOrUpdate_RemoteSupport.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_delete.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_delete.py index 5a9a2e137f81..92c5afd3df45 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_delete.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/EdgeDeviceJobs_Delete.json +# x-ms-original-file: 2026-04-30/EdgeDeviceJobs_Delete.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_get_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_get_remote_support.py index f33624eb1605..1f02a6398864 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_get_remote_support.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_get_remote_support.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/EdgeDeviceJobs_Get_RemoteSupport.json +# x-ms-original-file: 2026-04-30/EdgeDeviceJobs_Get_RemoteSupport.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_list_by_edge_device.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_list_by_edge_device.py index 638b47e2d929..40aaf56b696c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_list_by_edge_device.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_list_by_edge_device.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/EdgeDeviceJobs_ListByEdgeDevice.json +# x-ms-original-file: 2026-04-30/EdgeDeviceJobs_ListByEdgeDevice.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_collect_log.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_collect_log.py deleted file mode 100644 index dadcc8cef06f..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_collect_log.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_create_or_update_collect_log.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.begin_create_or_update( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="triggerLogCollection", - resource={"properties": {"deploymentMode": "Validate", "jobType": "EdgeMachineJobProperties"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_CreateOrUpdate_CollectLog.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_download_os.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_download_os.py deleted file mode 100644 index f602fcf2758d..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_download_os.py +++ /dev/null @@ -1,62 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_create_or_update_download_os.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.begin_create_or_update( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="DownloadOs", - resource={ - "properties": { - "deploymentMode": "Deploy", - "downloadRequest": { - "osProfile": { - "gpgPubKey": "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tXG5WZXJzaW9uOiBHbnVQRyB2MlxuXG5tUUVOQkZYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYXG4tLS0tLUVORCBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0t", - "imageHash": "sha256:a8b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1", - "osImageLocation": "https://aka.ms/aep/azlinux3.0", - "osName": "AzureLinux", - "osType": "AzureLinux", - "osVersion": "3.0", - "vsrVersion": "1.0.0", - }, - "target": "AzureLinux", - }, - "jobType": "DownloadOs", - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_CreateOrUpdate_DownloadOs.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_provision_os.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_provision_os.py deleted file mode 100644 index 8fe17aeabb75..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_provision_os.py +++ /dev/null @@ -1,98 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_create_or_update_provision_os.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.begin_create_or_update( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="ProvisionOs", - resource={ - "properties": { - "deploymentMode": "Deploy", - "jobType": "ProvisionOs", - "provisioningRequest": { - "customConfiguration": "eyJjdXN0b21Db25maWciOiAiZXhhbXBsZSBiYXNlNjQgZW5jb2RlZCBjb25maWcifQ==", - "deviceConfiguration": { - "hostName": "634b9db8-83e1-46ed-b391-c1614e2d0097", - "network": { - "networkAdapters": [ - { - "dnsAddressArray": ["8.8.8.8"], - "gateway": "", - "ipAddress": "", - "ipAddressRange": {"endIp": "", "startIp": ""}, - "ipAssignmentType": "Automatic", - "subnetMask": "", - "vlanId": "0", - } - ] - }, - "storage": {"partitionSize": "30GB"}, - "time": {"primaryTimeServer": "", "secondaryTimeServer": "", "timeZone": "UTC"}, - "webProxy": {"bypassList": [], "connectionUri": "https://microsoft.com/a", "port": ""}, - }, - "onboardingConfiguration": { - "arcVirtualMachineId": "634b9db8-83e1-46ed-b391-c1614e2d0097", - "location": "eastus", - "resourceId": "/subscriptions/ff0aa6da-20f8-44fe-9aee-381c8e8a4aeb/resourceGroups/bhukumar-test-rg/providers/Microsoft.HybridCompute/machines/bkumar-t1", - "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "type": "HybridComputeMachine", - }, - "osProfile": { - "gpgPubKey": "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tXG5WZXJzaW9uOiBHbnVQRyB2MlxuXG5tUUVOQkZYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYXG4tLS0tLUVORCBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0t", - "imageHash": "sha256:a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456", - "operationType": "Provision", - "osImageLocation": "https://aka.ms/aep/azlinux3.0", - "osName": "AzureLinux", - "osType": "AzureLinux", - "osVersion": "3.0", - "vsrVersion": "1.0.0", - }, - "target": "AzureLinux", - "userDetails": [ - { - "secretLocation": "https://bhukumar-test-kv.vault.azure.net/secrets/edgeuser/7b2d7db11bad4e1599cb6a0f4d2b2e00", - "secretType": "KeyVault", - "sshPubKey": ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7... edgeuser@example.com"], - "userName": "edgeuser", - } - ], - }, - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_CreateOrUpdate_ProvisionOs.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_remote_support.py deleted file mode 100644 index b73cd03b30d3..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_remote_support.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_create_or_update_remote_support.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.begin_create_or_update( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="RemoteSupport", - resource={ - "properties": { - "accessLevel": "Diagnostics", - "expirationTimestamp": "2024-01-29T10:43:27.9471574Z", - "jobType": "RemoteSupport", - "type": "Enable", - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_CreateOrUpdate_RemoteSupport.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_update_os.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_update_os.py deleted file mode 100644 index 80fbe6c750b8..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_update_os.py +++ /dev/null @@ -1,97 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_create_or_update_update_os.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.begin_create_or_update( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="UpdateOs", - resource={ - "properties": { - "deploymentMode": "Deploy", - "jobType": "ProvisionOs", - "provisioningRequest": { - "customConfiguration": "eyJjdXN0b21Db25maWciOiAiZXhhbXBsZSBiYXNlNjQgZW5jb2RlZCBjb25maWcifQ==", - "deviceConfiguration": { - "hostName": "634b9db8-83e1-46ed-b391-c1614e2d0097", - "network": { - "networkAdapters": [ - { - "dnsAddressArray": ["8.8.8.8"], - "gateway": "", - "ipAddress": "", - "ipAddressRange": {"endIp": "", "startIp": ""}, - "ipAssignmentType": "Automatic", - "subnetMask": "", - "vlanId": "0", - } - ] - }, - "time": {"primaryTimeServer": "", "secondaryTimeServer": "", "timeZone": "UTC"}, - "webProxy": {"bypassList": [], "connectionUri": "https://microsoft.com/a", "port": ""}, - }, - "onboardingConfiguration": { - "arcVirtualMachineId": "634b9db8-83e1-46ed-b391-c1614e2d0097", - "location": "eastus", - "resourceId": "/subscriptions/ff0aa6da-20f8-44fe-9aee-381c8e8a4aeb/resourceGroups/bhukumar-test-rg/providers/Microsoft.HybridCompute/machines/bkumar-t1", - "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "type": "HybridComputeMachine", - }, - "osProfile": { - "gpgPubKey": "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tXG5WZXJzaW9uOiBHbnVQRyB2MlxuXG5tUUVOQkZYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYXG4tLS0tLUVORCBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0t", - "imageHash": "sha256:b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef12345678", - "operationType": "Update", - "osImageLocation": "https://aka.ms/aep/azlinux3.1", - "osName": "AzureLinux", - "osType": "AzureLinux", - "osVersion": "3.1", - "vsrVersion": "1.1.0", - }, - "target": "AzureLinux", - "userDetails": [ - { - "secretLocation": "https://bhukumar-test-kv.vault.azure.net/secrets/edgeuser/7b2d7db11bad4e1599cb6a0f4d2b2e00", - "secretType": "KeyVault", - "sshPubKey": ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7... edgeuser@example.com"], - "userName": "edgeuser", - } - ], - }, - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_CreateOrUpdate_UpdateOs.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_delete_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_delete_maximum_set_gen.py deleted file mode 100644 index 33e7d0b41467..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_delete_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_delete_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.edge_machine_jobs.begin_delete( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="triggerLogCollection", - ).result() - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_Delete_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_collect_log.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_collect_log.py deleted file mode 100644 index 73dfae700d79..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_collect_log.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_get_collect_log.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.get( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="collectLog", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_Get_CollectLog.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_provision_os.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_provision_os.py deleted file mode 100644 index 867a028f1fe7..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_provision_os.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_get_provision_os.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.get( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="ProvisionOs", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_Get_ProvisionOs.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_remote_support.py deleted file mode 100644 index b85346b5356a..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_remote_support.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_get_remote_support.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.get( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - jobs_name="RemoteSupport", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_Get_RemoteSupport.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_list_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_list_maximum_set_gen.py deleted file mode 100644 index 62fa7d47296d..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_list_maximum_set_gen.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machine_jobs_list_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machine_jobs.list( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine1", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachineJobs_List_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_create_or_update.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_create_or_update.py deleted file mode 100644 index d898a45946aa..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_create_or_update.py +++ /dev/null @@ -1,50 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machines_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machines.begin_create_or_update( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine-1", - resource={ - "location": "eastus", - "properties": { - "arcMachineResourceGroupId": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg", - "arcMachineResourceId": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachines_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_delete.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_delete.py deleted file mode 100644 index e9fc3d17bcb7..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machines_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.edge_machines.begin_delete( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine-1", - ).result() - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachines_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_get.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_get.py deleted file mode 100644 index 5ef51de26ff4..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machines_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machines.get( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine-1", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachines_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_resource_group.py deleted file mode 100644 index 5ba9b6435727..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_resource_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machines_list_by_resource_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machines.list_by_resource_group( - resource_group_name="ArcInstance-rg", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachines_ListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_subscription.py deleted file mode 100644 index a25fcb030227..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_subscription.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machines_list_by_subscription.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machines.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachines_ListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_update.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_update.py deleted file mode 100644 index 5eca247d1483..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python edge_machines_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.edge_machines.begin_update( - resource_group_name="ArcInstance-rg", - edge_machine_name="machine-1", - properties={"tags": {"key2335": "beth"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-04-01-preview/EdgeMachines_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py index 2f30829cdaaa..e87864d132c5 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/ExtendSoftwareAssuranceBenefit.json +# x-ms-original-file: 2026-04-30/ExtendSoftwareAssuranceBenefit.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py index 3cefa72483a6..09c3de6b531b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/Extensions_Upgrade.json +# x-ms-original-file: 2026-04-30/Extensions_Upgrade.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py index bde9cf033fde..8f451e46999c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GeneratePassword.json +# x-ms-original-file: 2026-04-30/GeneratePassword.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py index 0e4befda048f..ff1215afc1cb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetArcSetting.json +# x-ms-original-file: 2026-04-30/GetArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py index e836e234da2e..4ff61900103b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetCluster.json +# x-ms-original-file: 2026-04-30/GetCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py index d9dbf9aa572a..1b69269e24f0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetDeploymentSettings.json +# x-ms-original-file: 2026-04-30/GetDeploymentSettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_edge_devices.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_edge_devices.py index 449b8f603458..aa9483dcd505 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_edge_devices.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_edge_devices.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetEdgeDevices.json +# x-ms-original-file: 2026-04-30/GetEdgeDevices.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py index c9f3808ca72f..20b9858c30de 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetExtension.json +# x-ms-original-file: 2026-04-30/GetExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py index 5113f8355a36..805d14a55e81 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetOffer.json +# x-ms-original-file: 2026-04-30/GetOffer.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py deleted file mode 100644 index af75478ce573..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python get_publisher.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.publishers.get( - resource_group_name="test-rg", - cluster_name="myCluster", - publisher_name="publisher1", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/GetPublisher.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py index 469947b0b416..78274e6343ea 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetSecuritySettings.json +# x-ms-original-file: 2026-04-30/GetSecuritySettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py index 74d6b72b3801..0134a52f80f8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetSku.json +# x-ms-original-file: 2026-04-30/GetSku.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py index 252a656ef8f9..e33486c0e41f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetUpdateRuns.json +# x-ms-original-file: 2026-04-30/GetUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py index d7b354bf103c..acddcee339d4 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetUpdateSummaries.json +# x-ms-original-file: 2026-04-30/GetUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py index 623e89f6bfa6..f3b58c8245cb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/GetUpdates.json +# x-ms-original-file: 2026-04-30/GetUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py index 1da4f904319e..29990751fc33 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/InitializeDisableProcess.json +# x-ms-original-file: 2026-04-30/InitializeDisableProcess.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.py deleted file mode 100644 index b286983ab129..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.kubernetes_versions.list_by_subscription_location_resource( - location="westus2", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/KubernetesVersions_ListBySubscriptionLocationResource_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py index 43d113d63243..261fd48a9906 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListArcSettingsByCluster.json +# x-ms-original-file: 2026-04-30/ListArcSettingsByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py index 82719c39349c..844fc6262d32 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListClustersByResourceGroup.json +# x-ms-original-file: 2026-04-30/ListClustersByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py index 4ece44b56cd8..6f16d986b54c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListClustersBySubscription.json +# x-ms-original-file: 2026-04-30/ListClustersBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py index 5989fa1c99bc..ad06e4f41465 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListDeploymentSettingsByCluster.json +# x-ms-original-file: 2026-04-30/ListDeploymentSettingsByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_edge_devices.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_edge_devices.py index f089feca0a15..8cc89221ca51 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_edge_devices.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_edge_devices.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListEdgeDevices.json +# x-ms-original-file: 2026-04-30/ListEdgeDevices.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py index 996a70642de5..722efe360369 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListExtensionsByArcSetting.json +# x-ms-original-file: 2026-04-30/ListExtensionsByArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py index d501aa43e49d..16108ffce023 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListOffersByCluster.json +# x-ms-original-file: 2026-04-30/ListOffersByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py index aa12742c29fc..533d461fbabb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListOffersByPublisher.json +# x-ms-original-file: 2026-04-30/ListOffersByPublisher.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py deleted file mode 100644 index 2a52bb07477d..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python list_publishers_by_cluster.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.publishers.list_by_cluster( - resource_group_name="test-rg", - cluster_name="myCluster", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/ListPublishersByCluster.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py index 468567778dc3..4bdbfb977186 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListSecuritySettingsByCluster.json +# x-ms-original-file: 2026-04-30/ListSecuritySettingsByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py index deb0899ba66c..de46c9c90638 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListSkusByOffer.json +# x-ms-original-file: 2026-04-30/ListSkusByOffer.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py index d369b57542ad..5112108718fe 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListUpdateRuns.json +# x-ms-original-file: 2026-04-30/ListUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py index 98ccd98dd56a..e1e81db8c8b2 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListUpdateSummaries.json +# x-ms-original-file: 2026-04-30/ListUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py index efad0996c24c..1ed75dbd449f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ListUpdates.json +# x-ms-original-file: 2026-04-30/ListUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/operations_list.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/operations_list.py index 38e53a9dc4ec..a0555a735917 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/operations_list.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/Operations_List.json +# x-ms-original-file: 2026-04-30/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_get_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_get_maximum_set_gen.py deleted file mode 100644 index fd6c2674769f..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_get_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python os_images_get_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.os_images.get( - location="arowdcr", - os_image_name="10.2408.0.1", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/OsImages_Get_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_list_by_subscription_location_resource_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_list_by_subscription_location_resource_maximum_set_gen.py deleted file mode 100644 index 3ccd69080089..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_list_by_subscription_location_resource_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python os_images_list_by_subscription_location_resource_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.os_images.list_by_subscription_location_resource( - location="westus2", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/OsImages_ListBySubscriptionLocationResource_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py index 18519761d0c3..40c66a567019 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PatchArcSetting.json +# x-ms-original-file: 2026-04-30/PatchArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py index e614c5e2063d..6bb434e505b2 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PatchExtension.json +# x-ms-original-file: 2026-04-30/PatchExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_get_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_get_maximum_set_gen.py deleted file mode 100644 index 952fe590586f..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_get_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python platform_updates_get_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.platform_updates.get( - location="westus2", - platform_update_name="10.2408.0.1", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/PlatformUpdates_Get_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_list_by_location_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_list_by_location_maximum_set_gen.py deleted file mode 100644 index 3eee3ff96674..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_list_by_location_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python platform_updates_list_by_location_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.platform_updates.list( - location="westus2", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/PlatformUpdates_ListByLocation_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py index fcd946c58696..2b522df1e0f1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/PostUpdates.json +# x-ms-original-file: 2026-04-30/PostUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_arc_setting.py index c26040958db9..c39208433a62 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_arc_setting.py @@ -68,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PutArcSetting.json +# x-ms-original-file: 2026-04-30/PutArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings.py index d1fe45599807..de3c1da48bc3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings.py @@ -79,6 +79,24 @@ def main(): }, } ], + "sanNetworks": { + "clusterNetworkConfig": { + "adapterIPConfig": [ + { + "addressPrefix": "10.10.30.0/24", + "name": "clusterNetwork-A", + "networkAdapterName": "ethernet 3", + "vlanId": 711, + } + ], + "adapterProperties": { + "bandwidthPercentageSmb": 50, + "jumboPacket": 9014, + "priorityValue8021ActionCluster": 7, + "priorityValue8021ActionSmb": 3, + }, + } + }, "storageConnectivitySwitchless": True, "storageNetworks": [ { @@ -148,7 +166,11 @@ def main(): "smbSigningEnforced": True, "wdacEnforced": True, }, - "storage": {"configurationMode": "Express"}, + "storage": { + "configurationMode": "Express", + "s2d": {"overprovisioningRatio": "2", "volumeType": "ThinProvisioned"}, + "storageType": "S2D", + }, }, "sbePartnerInfo": { "credentialList": [ @@ -183,6 +205,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PutDeploymentSettings.json +# x-ms-original-file: 2026-04-30/PutDeploymentSettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_storage_s2_d.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_storage_s2_d.py new file mode 100644 index 000000000000..02988fcd24a6 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_storage_s2_d.py @@ -0,0 +1,185 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_deployment_settings_storage_s2_d.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.deployment_settings.begin_create_or_update( + resource_group_name="test-rg", + cluster_name="myCluster", + resource={ + "properties": { + "arcNodeResourceIds": [ + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2", + ], + "deploymentConfiguration": { + "scaleUnits": [ + { + "deploymentData": { + "adouPath": "OU=ms169,DC=ASZ1PLab8,DC=nttest,DC=microsoft,DC=com", + "cluster": { + "azureServiceEndpoint": "core.windows.net", + "cloudAccountName": "myasestoragacct", + "name": "testHCICluster", + "witnessPath": "Cloud", + "witnessType": "Cloud", + }, + "domainFqdn": "ASZ1PLab8.nttest.microsoft.com", + "hostNetwork": { + "enableStorageAutoIp": False, + "intents": [ + { + "adapter": ["Port2"], + "adapterPropertyOverrides": { + "jumboPacket": "1514", + "networkDirect": "Enabled", + "networkDirectTechnology": "iWARP", + }, + "name": "Compute_Management", + "overrideAdapterProperty": False, + "overrideQosPolicy": False, + "overrideVirtualSwitchConfiguration": False, + "qosPolicyOverrides": { + "bandwidthPercentage_SMB": "50", + "priorityValue8021Action_Cluster": "7", + "priorityValue8021Action_SMB": "3", + }, + "trafficType": ["Compute", "Management"], + "virtualSwitchConfigurationOverrides": { + "enableIov": "True", + "loadBalancingAlgorithm": "HyperVPort", + }, + } + ], + "storageConnectivitySwitchless": True, + "storageNetworks": [ + { + "name": "Storage1Network", + "networkAdapterName": "Port3", + "storageAdapterIPInfo": [ + { + "ipv4Address": "10.57.48.60", + "physicalNode": "string", + "subnetMask": "255.255.248.0", + } + ], + "vlanId": "5", + } + ], + }, + "infrastructureNetwork": [ + { + "dnsServerConfig": "UseDnsServer", + "dnsServers": ["10.57.50.90"], + "gateway": "255.255.248.0", + "ipPools": [{"endingAddress": "10.57.48.66", "startingAddress": "10.57.48.60"}], + "subnetMask": "255.255.248.0", + } + ], + "isManagementCluster": True, + "namingPrefix": "ms169", + "observability": { + "episodicDataUpload": True, + "euLocation": False, + "streamingDataClient": True, + }, + "optionalServices": {"customLocation": "customLocationName"}, + "physicalNodes": [ + {"ipv4Address": "10.57.51.224", "name": "ms169host"}, + {"ipv4Address": "10.57.53.236", "name": "ms154host"}, + ], + "secrets": [ + { + "eceSecretName": "BMCAdminUserCred", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-BmcAdminUser-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4b", + "secretName": "cluster1-BmcAdminUser-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + }, + { + "eceSecretName": "AzureStackLCMUserCredential", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-AzureStackLCMUserCredential-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4c", + "secretName": "cluster2-AzureStackLCMUserCredential-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + }, + ], + "secretsLocation": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-xxxxxxx/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/abcd123", + "securitySettings": { + "bitlockerBootVolume": True, + "bitlockerDataVolumes": True, + "credentialGuardEnforced": False, + "driftControlEnforced": True, + "drtmProtection": True, + "hvciProtection": True, + "sideChannelMitigationEnforced": True, + "smbClusterEncryption": False, + "smbSigningEnforced": True, + "wdacEnforced": True, + }, + "storage": { + "configurationMode": "Express", + "s2d": {"overprovisioningRatio": "2", "volumeType": "ThinProvisioned"}, + "storageType": "S2D", + }, + }, + "sbePartnerInfo": { + "credentialList": [ + { + "eceSecretName": "DownloadConnectorCred", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-DownloadConnectorCred-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4b", + "secretName": "cluster1-DownloadConnectorCred-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + } + ], + "partnerProperties": [ + {"name": "EnableBMCIpV6", "value": "false"}, + {"name": "PhoneHomePort", "value": "1653"}, + {"name": "BMCSecurityState", "value": "HighSecurity"}, + ], + "sbeDeploymentInfo": { + "family": "Gen5", + "publisher": "Contoso", + "sbeManifestCreationDate": "2023-07-25T02:40:33Z", + "sbeManifestSource": "default", + "version": "4.0.2309.13", + }, + }, + } + ], + "version": "string", + }, + "deploymentMode": "Deploy", + "operationType": "ClusterProvisioning", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-04-30/PutDeploymentSettings_StorageS2D.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_storage_san.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_storage_san.py new file mode 100644 index 000000000000..ea9c14b1a692 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_storage_san.py @@ -0,0 +1,206 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_deployment_settings_storage_san.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.deployment_settings.begin_create_or_update( + resource_group_name="test-rg", + cluster_name="myCluster", + resource={ + "properties": { + "arcNodeResourceIds": [ + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2", + ], + "deploymentConfiguration": { + "scaleUnits": [ + { + "deploymentData": { + "adouPath": "OU=ms169,DC=ASZ1PLab8,DC=nttest,DC=microsoft,DC=com", + "cluster": { + "azureServiceEndpoint": "core.windows.net", + "cloudAccountName": "myasestoragacct", + "name": "testHCICluster", + "witnessPath": "Cloud", + "witnessType": "Cloud", + }, + "domainFqdn": "ASZ1PLab8.nttest.microsoft.com", + "hostNetwork": { + "enableStorageAutoIp": False, + "intents": [ + { + "adapter": ["Port2"], + "adapterPropertyOverrides": { + "jumboPacket": "1514", + "networkDirect": "Enabled", + "networkDirectTechnology": "iWARP", + }, + "name": "Compute_Management", + "overrideAdapterProperty": False, + "overrideQosPolicy": False, + "overrideVirtualSwitchConfiguration": False, + "qosPolicyOverrides": { + "bandwidthPercentage_SMB": "50", + "priorityValue8021Action_Cluster": "7", + "priorityValue8021Action_SMB": "3", + }, + "trafficType": ["Compute", "Management"], + "virtualSwitchConfigurationOverrides": { + "enableIov": "True", + "loadBalancingAlgorithm": "HyperVPort", + }, + } + ], + "sanNetworks": { + "clusterNetworkConfig": { + "adapterIPConfig": [ + { + "addressPrefix": "10.10.30.0/24", + "name": "clusterNetwork-A", + "networkAdapterName": "ethernet 3", + "vlanId": 711, + } + ], + "adapterProperties": { + "bandwidthPercentageSmb": 50, + "jumboPacket": 9014, + "priorityValue8021ActionCluster": 7, + "priorityValue8021ActionSmb": 3, + }, + } + }, + "storageConnectivitySwitchless": True, + "storageNetworks": [ + { + "name": "Storage1Network", + "networkAdapterName": "Port3", + "storageAdapterIPInfo": [ + { + "ipv4Address": "10.57.48.60", + "physicalNode": "string", + "subnetMask": "255.255.248.0", + } + ], + "vlanId": "5", + } + ], + }, + "infrastructureNetwork": [ + { + "dnsServerConfig": "UseDnsServer", + "dnsServers": ["10.57.50.90"], + "gateway": "255.255.248.0", + "ipPools": [{"endingAddress": "10.57.48.66", "startingAddress": "10.57.48.60"}], + "subnetMask": "255.255.248.0", + } + ], + "isManagementCluster": True, + "namingPrefix": "ms169", + "observability": { + "episodicDataUpload": True, + "euLocation": False, + "streamingDataClient": True, + }, + "optionalServices": {"customLocation": "customLocationName"}, + "physicalNodes": [ + {"ipv4Address": "10.57.51.224", "name": "ms169host"}, + {"ipv4Address": "10.57.53.236", "name": "ms154host"}, + ], + "secrets": [ + { + "eceSecretName": "BMCAdminUserCred", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-BmcAdminUser-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4b", + "secretName": "cluster1-BmcAdminUser-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + }, + { + "eceSecretName": "AzureStackLCMUserCredential", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-AzureStackLCMUserCredential-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4c", + "secretName": "cluster2-AzureStackLCMUserCredential-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + }, + ], + "secretsLocation": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-xxxxxxx/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/abcd123", + "securitySettings": { + "bitlockerBootVolume": True, + "bitlockerDataVolumes": True, + "credentialGuardEnforced": False, + "driftControlEnforced": True, + "drtmProtection": True, + "hvciProtection": True, + "sideChannelMitigationEnforced": True, + "smbClusterEncryption": False, + "smbSigningEnforced": True, + "wdacEnforced": True, + }, + "storage": { + "configurationMode": "Express", + "san": { + "infraPerfLunId": "PURE0987654321MNOPQR", + "infraVolLunId": "PURE1234567890ABCDEF", + }, + "storageType": "SAN", + }, + }, + "sbePartnerInfo": { + "credentialList": [ + { + "eceSecretName": "DownloadConnectorCred", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-DownloadConnectorCred-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4b", + "secretName": "cluster1-DownloadConnectorCred-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + } + ], + "partnerProperties": [ + {"name": "EnableBMCIpV6", "value": "false"}, + {"name": "PhoneHomePort", "value": "1653"}, + {"name": "BMCSecurityState", "value": "HighSecurity"}, + ], + "sbeDeploymentInfo": { + "family": "Gen5", + "publisher": "Contoso", + "sbeManifestCreationDate": "2023-07-25T02:40:33Z", + "sbeManifestSource": "default", + "version": "4.0.2309.13", + }, + }, + } + ], + "version": "string", + }, + "deploymentMode": "Deploy", + "operationType": "ClusterProvisioning", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-04-30/PutDeploymentSettings_StorageSAN.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_with_ad_less.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_with_ad_less.py index 9b42db583bb1..d2dcc10cbb54 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_with_ad_less.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_with_ad_less.py @@ -79,6 +79,24 @@ def main(): }, } ], + "sanNetworks": { + "clusterNetworkConfig": { + "adapterIPConfig": [ + { + "addressPrefix": "10.10.30.0/24", + "name": "clusterNetwork-A", + "networkAdapterName": "ethernet 3", + "vlanId": 711, + } + ], + "adapterProperties": { + "bandwidthPercentageSmb": 50, + "jumboPacket": 9014, + "priorityValue8021ActionCluster": 7, + "priorityValue8021ActionSmb": 3, + }, + } + }, "storageConnectivitySwitchless": True, "storageNetworks": [ { @@ -147,7 +165,11 @@ def main(): "smbSigningEnforced": True, "wdacEnforced": True, }, - "storage": {"configurationMode": "Express"}, + "storage": { + "configurationMode": "Express", + "s2d": {"overprovisioningRatio": "2", "volumeType": "ThinProvisioned"}, + "storageType": "S2D", + }, }, "sbePartnerInfo": { "credentialList": [ @@ -182,6 +204,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PutDeploymentSettingsWithADLess.json +# x-ms-original-file: 2026-04-30/PutDeploymentSettingsWithADLess.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py index 264143bd68e8..ea2643fad135 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PutExtension.json +# x-ms-original-file: 2026-04-30/PutExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_security_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_security_settings.py index 940e963a3309..aa990af700c6 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_security_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_security_settings.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PutSecuritySettings.json +# x-ms-original-file: 2026-04-30/PutSecuritySettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py index 18a4b2066946..6344e1dbbe9f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py @@ -64,6 +64,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PutUpdateRuns.json +# x-ms-original-file: 2026-04-30/PutUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py index 058530ca4877..5c2f1815f221 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PutUpdateSummaries.json +# x-ms-original-file: 2026-04-30/PutUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py index 2b6959ce4b59..3efc01e2afe0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/PutUpdates.json +# x-ms-original-file: 2026-04-30/PutUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/reconcile_arc_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/reconcile_arc_settings.py index e84ac7103c8c..4d7466581428 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/reconcile_arc_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/reconcile_arc_settings.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/reconcileArcSettings.json +# x-ms-original-file: 2026-04-30/reconcileArcSettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py index e88db2b062b9..71805479eb12 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/TriggerLogCollection.json +# x-ms-original-file: 2026-04-30/TriggerLogCollection.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py index 12e47d946cba..8961809f571b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/UpdateCluster.json +# x-ms-original-file: 2026-04-30/UpdateCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_get_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_get_maximum_set_gen.py deleted file mode 100644 index faeb06b3e106..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_get_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python update_contents_get_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.update_contents.get( - location="westus2", - update_content_name="12.2510.0.1", - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/UpdateContents_Get_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_list_by_location_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_list_by_location_maximum_set_gen.py deleted file mode 100644 index 3bade62d8c1c..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_list_by_location_maximum_set_gen.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python update_contents_list_by_location_maximum_set_gen.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.update_contents.list( - location="westus2", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-04-01-preview/UpdateContents_ListByLocation_MaximumSet_Gen.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_health.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_health.py index db3e46022b89..f4a619361842 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_health.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_health.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/UpdateSummaries_CheckHealth.json +# x-ms-original-file: 2026-04-30/UpdateSummaries_CheckHealth.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_updates.py index 8ad1c44d3c33..2b070ac6f03a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_updates.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/UpdateSummaries_CheckUpdates.json +# x-ms-original-file: 2026-04-30/UpdateSummaries_CheckUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_updates_maximum_set.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_updates_maximum_set.py index 61a36b377839..9abf00dbd9ea 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_updates_maximum_set.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_summaries_check_updates_maximum_set.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/UpdateSummaries_CheckUpdates_MaximumSet.json +# x-ms-original-file: 2026-04-30/UpdateSummaries_CheckUpdates_MaximumSet.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/updates_prepare.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/updates_prepare.py index 1c9d87f0ba6a..3dd95c2f9c6d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/updates_prepare.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/updates_prepare.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/Updates_Prepare.json +# x-ms-original-file: 2026-04-30/Updates_Prepare.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py index 5997c41504ce..0b3cf657ef4f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-04-01-preview/UploadCertificate.json +# x-ms-original-file: 2026-04-30/UploadCertificate.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_edge_devices.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_edge_devices.py index 327516dd5a43..285d81b86fc8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_edge_devices.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_edge_devices.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/ValidateEdgeDevices.json +# x-ms-original-file: 2026-04-30/ValidateEdgeDevices.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_ownership_vouchers_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_ownership_vouchers_by_resource_group.py deleted file mode 100644 index 81f8336b9c7e..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_ownership_vouchers_by_resource_group.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.azurestackhci import AzureStackHCIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-azurestackhci -# USAGE - python validate_ownership_vouchers_by_resource_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = AzureStackHCIClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.ownership_vouchers.validate( - resource_group_name="ArcInstance-rg", - location="westus", - validation_request={ - "ownershipVoucherDetails": [ - {"ownerKeyType": "MicrosoftManaged", "ownershipVoucher": "Device Model Ownership content"} - ] - }, - ) - print(response) - - -# x-ms-original-file: 2026-04-01-preview/ValidateOwnershipVouchers_ByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_get.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_get.py index 20a28d25d270..8947f468098f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_get.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-04-01-preview/ValidatedSolutionRecipes_Get.json +# x-ms-original-file: 2026-04-30/ValidatedSolutionRecipes_Get.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_list_by_subscription_location_resource.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_list_by_subscription_location_resource.py index f87adf1bf3a1..20782460a7ae 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_list_by_subscription_location_resource.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_list_by_subscription_location_resource.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-04-01-preview/ValidatedSolutionRecipes_ListBySubscriptionLocationResource.json +# x-ms-original-file: 2026-04-30/ValidatedSolutionRecipes_ListBySubscriptionLocationResource.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_cluster_jobs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_cluster_jobs_operations.py deleted file mode 100644 index ed6df25e605a..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_cluster_jobs_operations.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIClusterJobsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cluster_jobs_get(self, resource_group): - response = self.client.cluster_jobs.get( - resource_group_name=resource_group.name, - cluster_name="str", - jobs_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cluster_jobs_begin_create_or_update(self, resource_group): - response = self.client.cluster_jobs.begin_create_or_update( - resource_group_name=resource_group.name, - cluster_name="str", - jobs_name="str", - resource={ - "id": "str", - "name": "str", - "properties": "cluster_job_properties", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cluster_jobs_begin_delete(self, resource_group): - response = self.client.cluster_jobs.begin_delete( - resource_group_name=resource_group.name, - cluster_name="str", - jobs_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cluster_jobs_list(self, resource_group): - response = self.client.cluster_jobs.list( - resource_group_name=resource_group.name, - cluster_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_cluster_jobs_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_cluster_jobs_operations_async.py deleted file mode 100644 index 7d444113e014..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_cluster_jobs_operations_async.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIClusterJobsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cluster_jobs_get(self, resource_group): - response = await self.client.cluster_jobs.get( - resource_group_name=resource_group.name, - cluster_name="str", - jobs_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cluster_jobs_begin_create_or_update(self, resource_group): - response = await ( - await self.client.cluster_jobs.begin_create_or_update( - resource_group_name=resource_group.name, - cluster_name="str", - jobs_name="str", - resource={ - "id": "str", - "name": "str", - "properties": "cluster_job_properties", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cluster_jobs_begin_delete(self, resource_group): - response = await ( - await self.client.cluster_jobs.begin_delete( - resource_group_name=resource_group.name, - cluster_name="str", - jobs_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cluster_jobs_list(self, resource_group): - response = self.client.cluster_jobs.list( - resource_group_name=resource_group.name, - cluster_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations.py index aa59e61c3b78..28d2c620ae63 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations.py @@ -62,11 +62,6 @@ def test_clusters_create(self, resource_group): "cloudId": "str", "cloudManagementEndpoint": "str", "clusterPattern": "str", - "confidentialVmProperties": { - "confidentialVmIntent": "str", - "confidentialVmStatus": "str", - "confidentialVmStatusSummary": "str", - }, "connectivityStatus": "str", "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, "identityProvider": "str", @@ -160,13 +155,6 @@ def test_clusters_create(self, resource_group): "supportedCapabilities": ["str"], }, "resourceProviderObjectId": "str", - "ring": "str", - "sdnProperties": { - "sdnApiAddress": "str", - "sdnDomainName": "str", - "sdnIntegrationIntent": "str", - "sdnStatus": "str", - }, "secretsLocations": [{"secretsLocation": "str", "secretsType": "str"}], "serviceEndpoint": "str", "softwareAssuranceProperties": { @@ -296,18 +284,6 @@ def test_clusters_begin_extend_software_assurance_benefit(self, resource_group): # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_clusters_begin_change_ring(self, resource_group): - response = self.client.clusters.begin_change_ring( - resource_group_name=resource_group.name, - cluster_name="str", - change_ring_request={"properties": {"targetRing": "str"}}, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_clusters_begin_trigger_log_collection(self, resource_group): diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations_async.py index acfc91515a28..1f01a6d648db 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations_async.py @@ -63,11 +63,6 @@ async def test_clusters_create(self, resource_group): "cloudId": "str", "cloudManagementEndpoint": "str", "clusterPattern": "str", - "confidentialVmProperties": { - "confidentialVmIntent": "str", - "confidentialVmStatus": "str", - "confidentialVmStatusSummary": "str", - }, "connectivityStatus": "str", "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, "identityProvider": "str", @@ -161,13 +156,6 @@ async def test_clusters_create(self, resource_group): "supportedCapabilities": ["str"], }, "resourceProviderObjectId": "str", - "ring": "str", - "sdnProperties": { - "sdnApiAddress": "str", - "sdnDomainName": "str", - "sdnIntegrationIntent": "str", - "sdnStatus": "str", - }, "secretsLocations": [{"secretsLocation": "str", "secretsType": "str"}], "serviceEndpoint": "str", "softwareAssuranceProperties": { @@ -307,20 +295,6 @@ async def test_clusters_begin_extend_software_assurance_benefit(self, resource_g # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_clusters_begin_change_ring(self, resource_group): - response = await ( - await self.client.clusters.begin_change_ring( - resource_group_name=resource_group.name, - cluster_name="str", - change_ring_request={"properties": {"targetRing": "str"}}, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_clusters_begin_trigger_log_collection(self, resource_group): diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_device_pools_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_device_pools_operations.py deleted file mode 100644 index 5b89c17a3ea4..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_device_pools_operations.py +++ /dev/null @@ -1,160 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIDevicePoolsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_device_pools_get(self, resource_group): - response = self.client.device_pools.get( - resource_group_name=resource_group.name, - device_pool_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_device_pools_begin_create_or_update(self, resource_group): - response = self.client.device_pools.begin_create_or_update( - resource_group_name=resource_group.name, - device_pool_name="str", - resource={ - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "properties": { - "cloudId": "str", - "customLocationName": "str", - "customLocationResourceId": "str", - "devices": [{"claimedBy": "str", "deviceResourceId": "str"}], - "managedResourceGroup": "str", - "operationDetails": [ - { - "description": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "id": "str", - "name": "str", - "resourceId": "str", - "status": "str", - "type": "str", - } - ], - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_device_pools_begin_delete(self, resource_group): - response = self.client.device_pools.begin_delete( - resource_group_name=resource_group.name, - device_pool_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_device_pools_begin_update(self, resource_group): - response = self.client.device_pools.begin_update( - resource_group_name=resource_group.name, - device_pool_name="str", - properties={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "tags": {"str": "str"}, - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_device_pools_list_by_resource_group(self, resource_group): - response = self.client.device_pools.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_device_pools_list_by_subscription(self, resource_group): - response = self.client.device_pools.list_by_subscription() - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_device_pools_begin_claim_devices(self, resource_group): - response = self.client.device_pools.begin_claim_devices( - resource_group_name=resource_group.name, - device_pool_name="str", - body={"devices": ["str"], "claimedBy": "str"}, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_device_pools_begin_release_devices(self, resource_group): - response = self.client.device_pools.begin_release_devices( - resource_group_name=resource_group.name, - device_pool_name="str", - body={"devices": ["str"]}, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_device_pools_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_device_pools_operations_async.py deleted file mode 100644 index c229ac588ce3..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_device_pools_operations_async.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIDevicePoolsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_device_pools_get(self, resource_group): - response = await self.client.device_pools.get( - resource_group_name=resource_group.name, - device_pool_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_device_pools_begin_create_or_update(self, resource_group): - response = await ( - await self.client.device_pools.begin_create_or_update( - resource_group_name=resource_group.name, - device_pool_name="str", - resource={ - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "properties": { - "cloudId": "str", - "customLocationName": "str", - "customLocationResourceId": "str", - "devices": [{"claimedBy": "str", "deviceResourceId": "str"}], - "managedResourceGroup": "str", - "operationDetails": [ - { - "description": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "id": "str", - "name": "str", - "resourceId": "str", - "status": "str", - "type": "str", - } - ], - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_device_pools_begin_delete(self, resource_group): - response = await ( - await self.client.device_pools.begin_delete( - resource_group_name=resource_group.name, - device_pool_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_device_pools_begin_update(self, resource_group): - response = await ( - await self.client.device_pools.begin_update( - resource_group_name=resource_group.name, - device_pool_name="str", - properties={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "tags": {"str": "str"}, - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_device_pools_list_by_resource_group(self, resource_group): - response = self.client.device_pools.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_device_pools_list_by_subscription(self, resource_group): - response = self.client.device_pools.list_by_subscription() - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_device_pools_begin_claim_devices(self, resource_group): - response = await ( - await self.client.device_pools.begin_claim_devices( - resource_group_name=resource_group.name, - device_pool_name="str", - body={"devices": ["str"], "claimedBy": "str"}, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_device_pools_begin_release_devices(self, resource_group): - response = await ( - await self.client.device_pools.begin_release_devices( - resource_group_name=resource_group.name, - device_pool_name="str", - body={"devices": ["str"]}, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py index 42d2a47164fa..7def407e6dd3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py @@ -57,10 +57,6 @@ def test_edge_devices_begin_create_or_update(self, resource_group): }, "provisioningState": "str", "reportedProperties": { - "confidentialVmProfile": { - "igvmStatus": "str", - "statusDetails": [{"code": "str", "message": "str"}], - }, "deviceState": "str", "extensionProfile": { "extensions": [ @@ -143,7 +139,6 @@ def test_edge_devices_begin_create_or_update(self, resource_group): "vlanId": "str", } ], - "sdnProperties": {"sdnApiAddress": "str", "sdnDomainName": "str", "sdnStatus": "str"}, "switchDetails": [ { "extensions": [ @@ -157,7 +152,16 @@ def test_edge_devices_begin_create_or_update(self, resource_group): "osProfile": {"assemblyVersion": "str", "bootType": "str"}, "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, "storageProfile": { - "disks": [{"id": "str", "sizeInBytes": "str", "type": "str"}], + "disks": [ + { + "id": "str", + "isSupported": bool, + "manufacturer": "str", + "model": "str", + "sizeInBytes": "str", + "type": "str", + } + ], "poolableDisksCount": 0, }, }, diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations_async.py index 1d3fc0890b87..eb924f22c8a6 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations_async.py @@ -59,10 +59,6 @@ async def test_edge_devices_begin_create_or_update(self, resource_group): }, "provisioningState": "str", "reportedProperties": { - "confidentialVmProfile": { - "igvmStatus": "str", - "statusDetails": [{"code": "str", "message": "str"}], - }, "deviceState": "str", "extensionProfile": { "extensions": [ @@ -145,7 +141,6 @@ async def test_edge_devices_begin_create_or_update(self, resource_group): "vlanId": "str", } ], - "sdnProperties": {"sdnApiAddress": "str", "sdnDomainName": "str", "sdnStatus": "str"}, "switchDetails": [ { "extensions": [ @@ -159,7 +154,16 @@ async def test_edge_devices_begin_create_or_update(self, resource_group): "osProfile": {"assemblyVersion": "str", "bootType": "str"}, "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, "storageProfile": { - "disks": [{"id": "str", "sizeInBytes": "str", "type": "str"}], + "disks": [ + { + "id": "str", + "isSupported": bool, + "manufacturer": "str", + "model": "str", + "sizeInBytes": "str", + "type": "str", + } + ], "poolableDisksCount": 0, }, }, diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations.py deleted file mode 100644 index f04243b80402..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIEdgeMachineJobsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machine_jobs_get(self, resource_group): - response = self.client.edge_machine_jobs.get( - resource_group_name=resource_group.name, - edge_machine_name="str", - jobs_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machine_jobs_begin_create_or_update(self, resource_group): - response = self.client.edge_machine_jobs.begin_create_or_update( - resource_group_name=resource_group.name, - edge_machine_name="str", - jobs_name="str", - resource={ - "id": "str", - "name": "str", - "properties": "edge_machine_job_properties", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machine_jobs_begin_delete(self, resource_group): - response = self.client.edge_machine_jobs.begin_delete( - resource_group_name=resource_group.name, - edge_machine_name="str", - jobs_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machine_jobs_list(self, resource_group): - response = self.client.edge_machine_jobs.list( - resource_group_name=resource_group.name, - edge_machine_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations_async.py deleted file mode 100644 index a36bcb628488..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations_async.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIEdgeMachineJobsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machine_jobs_get(self, resource_group): - response = await self.client.edge_machine_jobs.get( - resource_group_name=resource_group.name, - edge_machine_name="str", - jobs_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machine_jobs_begin_create_or_update(self, resource_group): - response = await ( - await self.client.edge_machine_jobs.begin_create_or_update( - resource_group_name=resource_group.name, - edge_machine_name="str", - jobs_name="str", - resource={ - "id": "str", - "name": "str", - "properties": "edge_machine_job_properties", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machine_jobs_begin_delete(self, resource_group): - response = await ( - await self.client.edge_machine_jobs.begin_delete( - resource_group_name=resource_group.name, - edge_machine_name="str", - jobs_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machine_jobs_list(self, resource_group): - response = self.client.edge_machine_jobs.list( - resource_group_name=resource_group.name, - edge_machine_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations.py deleted file mode 100644 index 85dfad4a7bba..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations.py +++ /dev/null @@ -1,267 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIEdgeMachinesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machines_get(self, resource_group): - response = self.client.edge_machines.get( - resource_group_name=resource_group.name, - edge_machine_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machines_begin_create_or_update(self, resource_group): - response = self.client.edge_machines.begin_create_or_update( - resource_group_name=resource_group.name, - edge_machine_name="str", - resource={ - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "properties": { - "arcGatewayResourceId": "str", - "arcMachineResourceGroupId": "str", - "arcMachineResourceId": "str", - "claimedBy": "str", - "cloudId": "str", - "connectivityStatus": "str", - "devicePoolResourceId": "str", - "edgeMachineKind": "str", - "lastSyncTimestamp": "2020-02-20 00:00:00", - "machineState": "str", - "operationDetails": [ - { - "description": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "id": "str", - "name": "str", - "resourceId": "str", - "status": "str", - "type": "str", - } - ], - "ownershipVoucherDetails": { - "ownerKeyType": "str", - "ownershipVoucher": "str", - "validationDetails": { - "azureMachineId": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "id": "str", - "manufacturer": "str", - "modelName": "str", - "serialNumber": "str", - "validationStatus": "str", - "version": "str", - }, - }, - "provisioningDetails": { - "osProfile": { - "gpgPubKey": "str", - "imageHash": "str", - "operationType": "str", - "osImageLocation": "str", - "osName": "str", - "osType": "str", - "osVersion": "str", - "vsrVersion": "str", - }, - "userDetails": [ - {"secretType": "str", "userName": "str", "secretLocation": "str", "sshPubKey": ["str"]} - ], - }, - "provisioningState": "str", - "reportedProperties": { - "extensionProfile": { - "extensions": [ - { - "errorDetails": [{"exception": "str"}], - "extensionName": "str", - "extensionResourceId": "str", - "managedBy": "str", - "state": "str", - "typeHandlerVersion": "str", - } - ] - }, - "hardwareProfile": { - "cpuCores": 0, - "cpuSockets": 0, - "manufacturer": "str", - "memoryCapacityInGb": 0, - "model": "str", - "processorType": "str", - "serialNumber": "str", - }, - "lastUpdated": "2020-02-20 00:00:00", - "networkProfile": { - "nicDetails": [ - { - "adapterName": "str", - "componentId": "str", - "defaultGateway": "str", - "defaultIsolationId": "str", - "dnsServers": ["str"], - "driverVersion": "str", - "interfaceDescription": "str", - "ip4Address": "str", - "macAddress": "str", - "nicStatus": "str", - "nicType": "str", - "rdmaCapability": "str", - "slot": "str", - "subnetMask": "str", - "switchName": "str", - "vlanId": "str", - } - ], - "switchDetails": [ - { - "extensions": [ - {"extensionEnabled": bool, "extensionName": "str", "switchId": "str"} - ], - "switchName": "str", - "switchType": "str", - } - ], - }, - "osProfile": { - "assemblyVersion": "str", - "baseImageVersion": "str", - "bootType": "str", - "buildNumber": "str", - "imageVersion": "str", - "osSku": "str", - "osType": "str", - "osVersion": "str", - }, - "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, - "storageProfile": {"poolableDisksCount": 0}, - }, - "siteDetails": { - "siteResourceId": "str", - "deviceConfiguration": { - "hostName": "str", - "network": { - "networkAdapters": [ - { - "ipAssignmentType": "str", - "adapterName": "str", - "dnsAddressArray": ["str"], - "gateway": "str", - "ipAddress": "str", - "ipAddressRange": {"endIp": "str", "startIp": "str"}, - "macAddress": "str", - "subnetMask": "str", - "vlanId": "str", - } - ] - }, - "storage": {"partitionSize": "str"}, - "time": {"primaryTimeServer": "str", "secondaryTimeServer": "str", "timeZone": "str"}, - "webProxy": {"bypassList": ["str"], "connectionUri": "str", "port": "str"}, - }, - }, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machines_begin_update(self, resource_group): - response = self.client.edge_machines.begin_update( - resource_group_name=resource_group.name, - edge_machine_name="str", - properties={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "tags": {"str": "str"}, - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machines_begin_delete(self, resource_group): - response = self.client.edge_machines.begin_delete( - resource_group_name=resource_group.name, - edge_machine_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machines_list_by_resource_group(self, resource_group): - response = self.client.edge_machines.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_edge_machines_list_by_subscription(self, resource_group): - response = self.client.edge_machines.list_by_subscription() - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations_async.py deleted file mode 100644 index 1ce3f4a25003..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations_async.py +++ /dev/null @@ -1,274 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIEdgeMachinesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machines_get(self, resource_group): - response = await self.client.edge_machines.get( - resource_group_name=resource_group.name, - edge_machine_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machines_begin_create_or_update(self, resource_group): - response = await ( - await self.client.edge_machines.begin_create_or_update( - resource_group_name=resource_group.name, - edge_machine_name="str", - resource={ - "location": "str", - "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "properties": { - "arcGatewayResourceId": "str", - "arcMachineResourceGroupId": "str", - "arcMachineResourceId": "str", - "claimedBy": "str", - "cloudId": "str", - "connectivityStatus": "str", - "devicePoolResourceId": "str", - "edgeMachineKind": "str", - "lastSyncTimestamp": "2020-02-20 00:00:00", - "machineState": "str", - "operationDetails": [ - { - "description": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "id": "str", - "name": "str", - "resourceId": "str", - "status": "str", - "type": "str", - } - ], - "ownershipVoucherDetails": { - "ownerKeyType": "str", - "ownershipVoucher": "str", - "validationDetails": { - "azureMachineId": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "id": "str", - "manufacturer": "str", - "modelName": "str", - "serialNumber": "str", - "validationStatus": "str", - "version": "str", - }, - }, - "provisioningDetails": { - "osProfile": { - "gpgPubKey": "str", - "imageHash": "str", - "operationType": "str", - "osImageLocation": "str", - "osName": "str", - "osType": "str", - "osVersion": "str", - "vsrVersion": "str", - }, - "userDetails": [ - {"secretType": "str", "userName": "str", "secretLocation": "str", "sshPubKey": ["str"]} - ], - }, - "provisioningState": "str", - "reportedProperties": { - "extensionProfile": { - "extensions": [ - { - "errorDetails": [{"exception": "str"}], - "extensionName": "str", - "extensionResourceId": "str", - "managedBy": "str", - "state": "str", - "typeHandlerVersion": "str", - } - ] - }, - "hardwareProfile": { - "cpuCores": 0, - "cpuSockets": 0, - "manufacturer": "str", - "memoryCapacityInGb": 0, - "model": "str", - "processorType": "str", - "serialNumber": "str", - }, - "lastUpdated": "2020-02-20 00:00:00", - "networkProfile": { - "nicDetails": [ - { - "adapterName": "str", - "componentId": "str", - "defaultGateway": "str", - "defaultIsolationId": "str", - "dnsServers": ["str"], - "driverVersion": "str", - "interfaceDescription": "str", - "ip4Address": "str", - "macAddress": "str", - "nicStatus": "str", - "nicType": "str", - "rdmaCapability": "str", - "slot": "str", - "subnetMask": "str", - "switchName": "str", - "vlanId": "str", - } - ], - "switchDetails": [ - { - "extensions": [ - {"extensionEnabled": bool, "extensionName": "str", "switchId": "str"} - ], - "switchName": "str", - "switchType": "str", - } - ], - }, - "osProfile": { - "assemblyVersion": "str", - "baseImageVersion": "str", - "bootType": "str", - "buildNumber": "str", - "imageVersion": "str", - "osSku": "str", - "osType": "str", - "osVersion": "str", - }, - "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, - "storageProfile": {"poolableDisksCount": 0}, - }, - "siteDetails": { - "siteResourceId": "str", - "deviceConfiguration": { - "hostName": "str", - "network": { - "networkAdapters": [ - { - "ipAssignmentType": "str", - "adapterName": "str", - "dnsAddressArray": ["str"], - "gateway": "str", - "ipAddress": "str", - "ipAddressRange": {"endIp": "str", "startIp": "str"}, - "macAddress": "str", - "subnetMask": "str", - "vlanId": "str", - } - ] - }, - "storage": {"partitionSize": "str"}, - "time": {"primaryTimeServer": "str", "secondaryTimeServer": "str", "timeZone": "str"}, - "webProxy": {"bypassList": ["str"], "connectionUri": "str", "port": "str"}, - }, - }, - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machines_begin_update(self, resource_group): - response = await ( - await self.client.edge_machines.begin_update( - resource_group_name=resource_group.name, - edge_machine_name="str", - properties={ - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "tags": {"str": "str"}, - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machines_begin_delete(self, resource_group): - response = await ( - await self.client.edge_machines.begin_delete( - resource_group_name=resource_group.name, - edge_machine_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machines_list_by_resource_group(self, resource_group): - response = self.client.edge_machines.list_by_resource_group( - resource_group_name=resource_group.name, - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_edge_machines_list_by_subscription(self, resource_group): - response = self.client.edge_machines.list_by_subscription() - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations.py deleted file mode 100644 index 00d62c608010..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIKubernetesVersionsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_kubernetes_versions_list_by_subscription_location_resource(self, resource_group): - response = self.client.kubernetes_versions.list_by_subscription_location_resource( - location="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations_async.py deleted file mode 100644 index 6d1d7b2de058..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations_async.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIKubernetesVersionsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_kubernetes_versions_list_by_subscription_location_resource(self, resource_group): - response = self.client.kubernetes_versions.list_by_subscription_location_resource( - location="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations.py deleted file mode 100644 index a9920a1dfc3f..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIOsImagesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_os_images_get(self, resource_group): - response = self.client.os_images.get( - location="str", - os_image_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_os_images_list_by_subscription_location_resource(self, resource_group): - response = self.client.os_images.list_by_subscription_location_resource( - location="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations_async.py deleted file mode 100644 index 354f39cfe1e4..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations_async.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIOsImagesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_os_images_get(self, resource_group): - response = await self.client.os_images.get( - location="str", - os_image_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_os_images_list_by_subscription_location_resource(self, resource_group): - response = self.client.os_images.list_by_subscription_location_resource( - location="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations.py deleted file mode 100644 index 8e96f57ef8c9..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIOwnershipVouchersOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_ownership_vouchers_validate(self, resource_group): - response = self.client.ownership_vouchers.validate( - resource_group_name=resource_group.name, - location="str", - validation_request={ - "ownershipVoucherDetails": [ - { - "ownerKeyType": "str", - "ownershipVoucher": "str", - "validationDetails": { - "azureMachineId": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "id": "str", - "manufacturer": "str", - "modelName": "str", - "serialNumber": "str", - "validationStatus": "str", - "version": "str", - }, - } - ] - }, - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations_async.py deleted file mode 100644 index fea9a2e24530..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations_async.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIOwnershipVouchersOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_ownership_vouchers_validate(self, resource_group): - response = await self.client.ownership_vouchers.validate( - resource_group_name=resource_group.name, - location="str", - validation_request={ - "ownershipVoucherDetails": [ - { - "ownerKeyType": "str", - "ownershipVoucher": "str", - "validationDetails": { - "azureMachineId": "str", - "error": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - }, - "id": "str", - "manufacturer": "str", - "modelName": "str", - "serialNumber": "str", - "validationStatus": "str", - "version": "str", - }, - } - ] - }, - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations.py deleted file mode 100644 index 7f7aacb9b283..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIPlatformUpdatesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_platform_updates_get(self, resource_group): - response = self.client.platform_updates.get( - location="str", - platform_update_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_platform_updates_list(self, resource_group): - response = self.client.platform_updates.list( - location="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations_async.py deleted file mode 100644 index 36bf46ce3d10..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations_async.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIPlatformUpdatesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_platform_updates_get(self, resource_group): - response = await self.client.platform_updates.get( - location="str", - platform_update_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_platform_updates_list(self, resource_group): - response = self.client.platform_updates.list( - location="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations.py deleted file mode 100644 index 9381bde678af..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIPublishersOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_publishers_get(self, resource_group): - response = self.client.publishers.get( - resource_group_name=resource_group.name, - cluster_name="str", - publisher_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_publishers_list_by_cluster(self, resource_group): - response = self.client.publishers.list_by_cluster( - resource_group_name=resource_group.name, - cluster_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations_async.py deleted file mode 100644 index e5fea572c422..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations_async.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIPublishersOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_publishers_get(self, resource_group): - response = await self.client.publishers.get( - resource_group_name=resource_group.name, - cluster_name="str", - publisher_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_publishers_list_by_cluster(self, resource_group): - response = self.client.publishers.list_by_cluster( - resource_group_name=resource_group.name, - cluster_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations.py deleted file mode 100644 index 7ab58d06aabb..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIUpdateContentsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_update_contents_get(self, resource_group): - response = self.client.update_contents.get( - location="str", - update_content_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_update_contents_list(self, resource_group): - response = self.client.update_contents.list( - location="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations_async.py deleted file mode 100644 index 30a206426a11..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations_async.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.azurestackhci.aio import AzureStackHCIClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestAzureStackHCIUpdateContentsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_update_contents_get(self, resource_group): - response = await self.client.update_contents.get( - location="str", - update_content_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_update_contents_list(self, resource_group): - response = self.client.update_contents.list( - location="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/pyproject.toml b/sdk/azurestackhci/azure-mgmt-azurestackhci/pyproject.toml index 98a450941b32..96bc944245c4 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/pyproject.toml +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/pyproject.toml @@ -13,17 +13,16 @@ authors = [ description = "Microsoft Azure Azurestackhci Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", @@ -79,7 +78,7 @@ package_name = "azure-mgmt-azurestackhci" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Azure Stack HCI Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true title = "AzureStackHCIClient" need_msrestazure = false diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/tsp-location.yaml b/sdk/azurestackhci/azure-mgmt-azurestackhci/tsp-location.yaml index c2f60f9f7a25..060bebfaf05b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/tsp-location.yaml +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI -commit: c22e8792df237fd9afe601d69e305504679c42af +commit: 675a8ce1a1d7489731bc8bd05d8d3e7d865434e0 repo: Azure/azure-rest-api-specs additionalDirectories: