diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/CHANGELOG.md b/sdk/networkcloud/azure-mgmt-networkcloud/CHANGELOG.md index e10fc45c6ae6..58d5f12f62ee 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/CHANGELOG.md +++ b/sdk/networkcloud/azure-mgmt-networkcloud/CHANGELOG.md @@ -1,5 +1,79 @@ # Release History +## 3.0.0b2 (2026-05-06) + +### Features Added + + - Client `NetworkCloudMgmtClient` added operation group `access_bridges` + - Client `NetworkCloudMgmtClient` added operation group `kubernetes_versions` + - Model `BareMetalMachineProperties` added property `bmc_ipv4_address` + - Model `BareMetalMachineProperties` added property `bmc_ipv6_address` + - Model `BareMetalMachineProperties` added property `monitoring_configuration_status` + - Enum `CloudServicesNetworkStorageStatusStatus` added member `INITIALIZING` + - Enum `CloudServicesNetworkStorageStatusStatus` added member `NONE` + - Enum `CloudServicesNetworkStorageStatusStatus` added member `REPAIRING` + - Model `Cluster` added property `kind` + - Model `ClusterContinueUpdateVersionParameters` added property `safeguard_mode` + - Model `ClusterManager` added property `kind` + - Model `ClusterManagerProperties` added property `relay_configuration` + - Model `ClusterProperties` added property `last_successful_version_update_time` + - Model `ClusterProperties` added property `managed_credentials` + - Model `ClusterUpdateVersionParameters` added property `safeguard_mode` + - Enum `CommandOutputType` added member `CLUSTER_SUPPORT_ADMINISTRATIVE_ACTIONS` + - Model `RackSkuProperties` added property `deployment_type` + - Model `RuntimeProtectionConfiguration` added property `definition_update_mode` + - Model `RuntimeProtectionStatus` added property `agent_health_status` + - Model `RuntimeProtectionStatus` added property `agent_health_status_issues` + - Model `RuntimeProtectionStatus` added property `agent_license_status` + - Model `RuntimeProtectionStatus` added property `definition_update_mode` + - Model `RuntimeProtectionStatus` added property `enforcement_level` + - Model `StorageApplianceProperties` added property `expansion_shelves` + - Model `StorageApplianceProperties` added property `monitoring_configuration_status` + - Model `VolumeProperties` added property `assigned_storage_appliance_id` + - Added model `AccessBridge` + - Added enum `AccessBridgeAllowedName` + - Added enum `AccessBridgeDetailedStatus` + - Added model `AccessBridgeEndpoint` + - Added model `AccessBridgePatchParameters` + - Added model `AccessBridgePatchProperties` + - Added model `AccessBridgeProperties` + - Added enum `AccessBridgeProvisioningState` + - Added model `AccessBridgeSecurityRule` + - Added enum `BareMetalMachineMetricsConfigurationStatusLogLevel` + - Added enum `BareMetalMachineMetricsConfigurationStatusMetricsLevel` + - Added model `BareMetalMachineMonitoringConfigurationStatus` + - Added model `BareMetalMachineReimageParameters` + - Added enum `BareMetalMachineReimageSafeguardMode` + - Added enum `ClusterContinueUpdateVersionSafeguardMode` + - Added enum `ClusterInspectAdditionalAction` + - Added model `ClusterInspectParameters` + - Added model `ClusterManagerRelayConfiguration` + - Added model `ClusterManagerUpdateRelayPrivateEndpointConnectionParameters` + - Added model `ClusterRotateCredentialParameters` + - Added enum `ClusterUpdateVersionSafeguardMode` + - Added enum `DeploymentType` + - Added model `FilterDevices` + - Added model `KubernetesVersion` + - Added model `KubernetesVersionPatchParameters` + - Added model `KubernetesVersionProperties` + - Added enum `KubernetesVersionProvisioningState` + - Added model `KubernetesVersionValue` + - Added enum `RelayPrivateEndpointConnectionState` + - Added enum `RuntimeProtectionAgentHealthStatus` + - Added enum `RuntimeProtectionAgentLicenseStatus` + - Added enum `RuntimeProtectionDefinitionUpdateMode` + - Added enum `SecurityRuleDirection` + - Added model `StorageApplianceExpansionShelf` + - Added enum `StorageApplianceMetricsConfigurationStatusLogLevel` + - Added enum `StorageApplianceMetricsConfigurationStatusMetricsLevel` + - Added model `StorageApplianceMonitoringConfigurationStatus` + - Added enum `TransportProtocol` + - Model `ClusterManagersOperations` added method `begin_update_relay_private_endpoint_connection` + - Model `ClustersOperations` added method `begin_inspect` + - Model `ClustersOperations` added method `begin_rotate_credential` + - Added model `AccessBridgesOperations` + - Added model `KubernetesVersionsOperations` + ## 3.0.0b1 (2026-04-02) ### Features Added diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/README.md b/sdk/networkcloud/azure-mgmt-networkcloud/README.md index 2144fc46487d..63ebaeeb3925 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/README.md +++ b/sdk/networkcloud/azure-mgmt-networkcloud/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Networkcloud 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/networkcloud/azure-mgmt-networkcloud/_metadata.json b/sdk/networkcloud/azure-mgmt-networkcloud/_metadata.json index 999ca3729abd..d73eda2a3c20 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/_metadata.json +++ b/sdk/networkcloud/azure-mgmt-networkcloud/_metadata.json @@ -1,10 +1,10 @@ { - "apiVersion": "2025-09-01", + "apiVersion": "2026-05-01-preview", "apiVersions": { - "Microsoft.NetworkCloud": "2025-09-01" + "Microsoft.NetworkCloud": "2026-05-01-preview" }, - "commit": "0b5796a12cf5dca2f6b8ec3dce4566806497986c", + "commit": "13c2dbb75b6428e8a8e0751e40fe1e3dbc453d8b", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/networkcloud/NetworkCloud.Management", - "emitterVersion": "0.61.2" + "emitterVersion": "0.61.3" } \ No newline at end of file diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/apiview-properties.json b/sdk/networkcloud/azure-mgmt-networkcloud/apiview-properties.json index 6d0409ccdad3..78b115be985e 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/apiview-properties.json +++ b/sdk/networkcloud/azure-mgmt-networkcloud/apiview-properties.json @@ -2,13 +2,19 @@ "CrossLanguagePackageId": "Microsoft.NetworkCloud", "CrossLanguageDefinitionId": { "azure.mgmt.networkcloud.models.AadConfiguration": "Microsoft.NetworkCloud.AadConfiguration", + "azure.mgmt.networkcloud.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.networkcloud.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.networkcloud.models.AccessBridge": "Microsoft.NetworkCloud.AccessBridge", + "azure.mgmt.networkcloud.models.AccessBridgeEndpoint": "Microsoft.NetworkCloud.AccessBridgeEndpoint", + "azure.mgmt.networkcloud.models.AccessBridgePatchParameters": "Microsoft.NetworkCloud.AccessBridgePatchParameters", + "azure.mgmt.networkcloud.models.AccessBridgePatchProperties": "Microsoft.NetworkCloud.AccessBridgePatchProperties", + "azure.mgmt.networkcloud.models.AccessBridgeProperties": "Microsoft.NetworkCloud.AccessBridgeProperties", + "azure.mgmt.networkcloud.models.AccessBridgeSecurityRule": "Microsoft.NetworkCloud.AccessBridgeSecurityRule", "azure.mgmt.networkcloud.models.ActionState": "Microsoft.NetworkCloud.ActionState", "azure.mgmt.networkcloud.models.AdministrativeCredentials": "Microsoft.NetworkCloud.AdministrativeCredentials", "azure.mgmt.networkcloud.models.AdministratorConfiguration": "Microsoft.NetworkCloud.AdministratorConfiguration", "azure.mgmt.networkcloud.models.AdministratorConfigurationPatch": "Microsoft.NetworkCloud.AdministratorConfigurationPatch", "azure.mgmt.networkcloud.models.AgentOptions": "Microsoft.NetworkCloud.AgentOptions", - "azure.mgmt.networkcloud.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", - "azure.mgmt.networkcloud.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", "azure.mgmt.networkcloud.models.AgentPool": "Microsoft.NetworkCloud.AgentPool", "azure.mgmt.networkcloud.models.AgentPoolPatchParameters": "Microsoft.NetworkCloud.AgentPoolPatchParameters", "azure.mgmt.networkcloud.models.AgentPoolPatchProperties": "Microsoft.NetworkCloud.AgentPoolPatchProperties", @@ -25,10 +31,12 @@ "azure.mgmt.networkcloud.models.BareMetalMachineKeySetPatchParameters": "Microsoft.NetworkCloud.BareMetalMachineKeySetPatchParameters", "azure.mgmt.networkcloud.models.BareMetalMachineKeySetPatchProperties": "Microsoft.NetworkCloud.BareMetalMachineKeySetPatchProperties", "azure.mgmt.networkcloud.models.BareMetalMachineKeySetProperties": "Microsoft.NetworkCloud.BareMetalMachineKeySetProperties", + "azure.mgmt.networkcloud.models.BareMetalMachineMonitoringConfigurationStatus": "Microsoft.NetworkCloud.BareMetalMachineMonitoringConfigurationStatus", "azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters": "Microsoft.NetworkCloud.BareMetalMachinePatchParameters", "azure.mgmt.networkcloud.models.BareMetalMachinePatchProperties": "Microsoft.NetworkCloud.BareMetalMachinePatchProperties", "azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters": "Microsoft.NetworkCloud.BareMetalMachinePowerOffParameters", "azure.mgmt.networkcloud.models.BareMetalMachineProperties": "Microsoft.NetworkCloud.BareMetalMachineProperties", + "azure.mgmt.networkcloud.models.BareMetalMachineReimageParameters": "Microsoft.NetworkCloud.BareMetalMachineReimageParameters", "azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters": "Microsoft.NetworkCloud.BareMetalMachineReplaceParameters", "azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters": "Microsoft.NetworkCloud.BareMetalMachineRunCommandParameters", "azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters": "Microsoft.NetworkCloud.BareMetalMachineRunDataExtractsParameters", @@ -53,9 +61,12 @@ "azure.mgmt.networkcloud.models.ClusterCapacity": "Microsoft.NetworkCloud.ClusterCapacity", "azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters": "Microsoft.NetworkCloud.ClusterContinueUpdateVersionParameters", "azure.mgmt.networkcloud.models.ClusterDeployParameters": "Microsoft.NetworkCloud.ClusterDeployParameters", + "azure.mgmt.networkcloud.models.ClusterInspectParameters": "Microsoft.NetworkCloud.ClusterInspectParameters", "azure.mgmt.networkcloud.models.ClusterManager": "Microsoft.NetworkCloud.ClusterManager", "azure.mgmt.networkcloud.models.ClusterManagerPatchParameters": "Microsoft.NetworkCloud.ClusterManagerPatchParameters", "azure.mgmt.networkcloud.models.ClusterManagerProperties": "Microsoft.NetworkCloud.ClusterManagerProperties", + "azure.mgmt.networkcloud.models.ClusterManagerRelayConfiguration": "Microsoft.NetworkCloud.ClusterManagerRelayConfiguration", + "azure.mgmt.networkcloud.models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters": "Microsoft.NetworkCloud.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters", "azure.mgmt.networkcloud.models.ClusterMetricsConfiguration": "Microsoft.NetworkCloud.ClusterMetricsConfiguration", "azure.mgmt.networkcloud.models.ClusterMetricsConfigurationPatchParameters": "Microsoft.NetworkCloud.ClusterMetricsConfigurationPatchParameters", "azure.mgmt.networkcloud.models.ClusterMetricsConfigurationPatchProperties": "Microsoft.NetworkCloud.ClusterMetricsConfigurationPatchProperties", @@ -63,6 +74,7 @@ "azure.mgmt.networkcloud.models.ClusterPatchParameters": "Microsoft.NetworkCloud.ClusterPatchParameters", "azure.mgmt.networkcloud.models.ClusterPatchProperties": "Microsoft.NetworkCloud.ClusterPatchProperties", "azure.mgmt.networkcloud.models.ClusterProperties": "Microsoft.NetworkCloud.ClusterProperties", + "azure.mgmt.networkcloud.models.ClusterRotateCredentialParameters": "Microsoft.NetworkCloud.ClusterRotateCredentialParameters", "azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters": "Microsoft.NetworkCloud.ClusterScanRuntimeParameters", "azure.mgmt.networkcloud.models.ClusterSecretArchive": "Microsoft.NetworkCloud.ClusterSecretArchive", "azure.mgmt.networkcloud.models.ClusterUpdateStrategy": "Microsoft.NetworkCloud.ClusterUpdateStrategy", @@ -82,6 +94,7 @@ "azure.mgmt.networkcloud.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", "azure.mgmt.networkcloud.models.ExtendedLocation": "Azure.ResourceManager.CommonTypes.ExtendedLocation", "azure.mgmt.networkcloud.models.FeatureStatus": "Microsoft.NetworkCloud.FeatureStatus", + "azure.mgmt.networkcloud.models.FilterDevices": "Microsoft.NetworkCloud.FilterDevices", "azure.mgmt.networkcloud.models.HardwareInventory": "Microsoft.NetworkCloud.HardwareInventory", "azure.mgmt.networkcloud.models.HardwareInventoryNetworkInterface": "Microsoft.NetworkCloud.HardwareInventoryNetworkInterface", "azure.mgmt.networkcloud.models.HardwareValidationStatus": "Microsoft.NetworkCloud.HardwareValidationStatus", @@ -102,6 +115,10 @@ "azure.mgmt.networkcloud.models.KubernetesClusterProperties": "Microsoft.NetworkCloud.KubernetesClusterProperties", "azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters": "Microsoft.NetworkCloud.KubernetesClusterRestartNodeParameters", "azure.mgmt.networkcloud.models.KubernetesLabel": "Microsoft.NetworkCloud.KubernetesLabel", + "azure.mgmt.networkcloud.models.KubernetesVersion": "Microsoft.NetworkCloud.KubernetesVersion", + "azure.mgmt.networkcloud.models.KubernetesVersionPatchParameters": "Microsoft.NetworkCloud.KubernetesVersionPatchParameters", + "azure.mgmt.networkcloud.models.KubernetesVersionProperties": "Microsoft.NetworkCloud.KubernetesVersionProperties", + "azure.mgmt.networkcloud.models.KubernetesVersionValue": "Microsoft.NetworkCloud.KubernetesVersionValue", "azure.mgmt.networkcloud.models.L2Network": "Microsoft.NetworkCloud.L2Network", "azure.mgmt.networkcloud.models.L2NetworkAttachmentConfiguration": "Microsoft.NetworkCloud.L2NetworkAttachmentConfiguration", "azure.mgmt.networkcloud.models.L2NetworkPatchParameters": "Microsoft.NetworkCloud.L2NetworkPatchParameters", @@ -148,6 +165,8 @@ "azure.mgmt.networkcloud.models.StorageApplianceCommandSpecification": "Microsoft.NetworkCloud.StorageApplianceCommandSpecification", "azure.mgmt.networkcloud.models.StorageApplianceConfigurationData": "Microsoft.NetworkCloud.StorageApplianceConfigurationData", "azure.mgmt.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters": "Microsoft.NetworkCloud.StorageApplianceEnableRemoteVendorManagementParameters", + "azure.mgmt.networkcloud.models.StorageApplianceExpansionShelf": "Microsoft.NetworkCloud.StorageApplianceExpansionShelf", + "azure.mgmt.networkcloud.models.StorageApplianceMonitoringConfigurationStatus": "Microsoft.NetworkCloud.StorageApplianceMonitoringConfigurationStatus", "azure.mgmt.networkcloud.models.StorageAppliancePatchParameters": "Microsoft.NetworkCloud.StorageAppliancePatchParameters", "azure.mgmt.networkcloud.models.StorageAppliancePatchProperties": "Microsoft.NetworkCloud.StorageAppliancePatchProperties", "azure.mgmt.networkcloud.models.StorageApplianceProperties": "Microsoft.NetworkCloud.StorageApplianceProperties", @@ -178,17 +197,29 @@ "azure.mgmt.networkcloud.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", "azure.mgmt.networkcloud.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", "azure.mgmt.networkcloud.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.networkcloud.models.SecurityRuleDirection": "Microsoft.NetworkCloud.SecurityRuleDirection", + "azure.mgmt.networkcloud.models.AccessBridgeDetailedStatus": "Microsoft.NetworkCloud.AccessBridgeDetailedStatus", + "azure.mgmt.networkcloud.models.TransportProtocol": "Microsoft.NetworkCloud.TransportProtocol", + "azure.mgmt.networkcloud.models.AccessBridgeProvisioningState": "Microsoft.NetworkCloud.AccessBridgeProvisioningState", + "azure.mgmt.networkcloud.models.ExtendedLocationType": "Azure.ResourceManager.CommonTypes.ExtendedLocationType", + "azure.mgmt.networkcloud.models.AccessBridgeAllowedName": "Microsoft.NetworkCloud.AccessBridgeAllowedName", "azure.mgmt.networkcloud.models.ActionStateStatus": "Microsoft.NetworkCloud.ActionStateStatus", "azure.mgmt.networkcloud.models.StepStateStatus": "Microsoft.NetworkCloud.StepStateStatus", "azure.mgmt.networkcloud.models.BareMetalMachineCordonStatus": "Microsoft.NetworkCloud.BareMetalMachineCordonStatus", "azure.mgmt.networkcloud.models.BareMetalMachineDetailedStatus": "Microsoft.NetworkCloud.BareMetalMachineDetailedStatus", "azure.mgmt.networkcloud.models.BareMetalMachineHardwareValidationResult": "Microsoft.NetworkCloud.BareMetalMachineHardwareValidationResult", + "azure.mgmt.networkcloud.models.BareMetalMachineMetricsConfigurationStatusLogLevel": "Microsoft.NetworkCloud.BareMetalMachineMetricsConfigurationStatusLogLevel", + "azure.mgmt.networkcloud.models.BareMetalMachineMetricsConfigurationStatusMetricsLevel": "Microsoft.NetworkCloud.BareMetalMachineMetricsConfigurationStatusMetricsLevel", "azure.mgmt.networkcloud.models.BareMetalMachinePowerState": "Microsoft.NetworkCloud.BareMetalMachinePowerState", "azure.mgmt.networkcloud.models.BareMetalMachineReadyState": "Microsoft.NetworkCloud.BareMetalMachineReadyState", + "azure.mgmt.networkcloud.models.RuntimeProtectionAgentHealthStatus": "Microsoft.NetworkCloud.RuntimeProtectionAgentHealthStatus", + "azure.mgmt.networkcloud.models.RuntimeProtectionAgentLicenseStatus": "Microsoft.NetworkCloud.RuntimeProtectionAgentLicenseStatus", + "azure.mgmt.networkcloud.models.RuntimeProtectionDefinitionUpdateMode": "Microsoft.NetworkCloud.RuntimeProtectionDefinitionUpdateMode", + "azure.mgmt.networkcloud.models.RuntimeProtectionEnforcementLevel": "Microsoft.NetworkCloud.RuntimeProtectionEnforcementLevel", "azure.mgmt.networkcloud.models.BareMetalMachineProvisioningState": "Microsoft.NetworkCloud.BareMetalMachineProvisioningState", - "azure.mgmt.networkcloud.models.ExtendedLocationType": "Azure.ResourceManager.CommonTypes.ExtendedLocationType", "azure.mgmt.networkcloud.models.BareMetalMachineEvacuate": "Microsoft.NetworkCloud.BareMetalMachineEvacuate", "azure.mgmt.networkcloud.models.BareMetalMachineSkipShutdown": "Microsoft.NetworkCloud.BareMetalMachineSkipShutdown", + "azure.mgmt.networkcloud.models.BareMetalMachineReimageSafeguardMode": "Microsoft.NetworkCloud.BareMetalMachineReimageSafeguardMode", "azure.mgmt.networkcloud.models.BareMetalMachineReplaceSafeguardMode": "Microsoft.NetworkCloud.BareMetalMachineReplaceSafeguardMode", "azure.mgmt.networkcloud.models.BareMetalMachineReplaceStoragePolicy": "Microsoft.NetworkCloud.BareMetalMachineReplaceStoragePolicy", "azure.mgmt.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints": "Microsoft.NetworkCloud.CloudServicesNetworkEnableDefaultEgressEndpoints", @@ -199,12 +230,13 @@ "azure.mgmt.networkcloud.models.ClusterManagerDetailedStatus": "Microsoft.NetworkCloud.ClusterManagerDetailedStatus", "azure.mgmt.networkcloud.models.ClusterManagerProvisioningState": "Microsoft.NetworkCloud.ClusterManagerProvisioningState", "azure.mgmt.networkcloud.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "azure.mgmt.networkcloud.models.DeploymentType": "Microsoft.NetworkCloud.DeploymentType", + "azure.mgmt.networkcloud.models.RelayPrivateEndpointConnectionState": "Microsoft.NetworkCloud.RelayPrivateEndpointConnectionState", "azure.mgmt.networkcloud.models.ManagedServiceIdentitySelectorType": "Microsoft.NetworkCloud.ManagedServiceIdentitySelectorType", "azure.mgmt.networkcloud.models.ClusterType": "Microsoft.NetworkCloud.ClusterType", "azure.mgmt.networkcloud.models.CommandOutputType": "Microsoft.NetworkCloud.CommandOutputType", "azure.mgmt.networkcloud.models.ValidationThresholdGrouping": "Microsoft.NetworkCloud.ValidationThresholdGrouping", "azure.mgmt.networkcloud.models.ValidationThresholdType": "Microsoft.NetworkCloud.ValidationThresholdType", - "azure.mgmt.networkcloud.models.RuntimeProtectionEnforcementLevel": "Microsoft.NetworkCloud.RuntimeProtectionEnforcementLevel", "azure.mgmt.networkcloud.models.ClusterSecretArchiveEnabled": "Microsoft.NetworkCloud.ClusterSecretArchiveEnabled", "azure.mgmt.networkcloud.models.ClusterUpdateStrategyType": "Microsoft.NetworkCloud.ClusterUpdateStrategyType", "azure.mgmt.networkcloud.models.VulnerabilityScanningSettingsContainerScan": "Microsoft.NetworkCloud.VulnerabilityScanningSettingsContainerScan", @@ -215,7 +247,10 @@ "azure.mgmt.networkcloud.models.ClusterDetailedStatus": "Microsoft.NetworkCloud.ClusterDetailedStatus", "azure.mgmt.networkcloud.models.ClusterProvisioningState": "Microsoft.NetworkCloud.ClusterProvisioningState", "azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionMachineGroupTargetingMode": "Microsoft.NetworkCloud.ClusterContinueUpdateVersionMachineGroupTargetingMode", + "azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionSafeguardMode": "Microsoft.NetworkCloud.ClusterContinueUpdateVersionSafeguardMode", + "azure.mgmt.networkcloud.models.ClusterInspectAdditionalAction": "Microsoft.NetworkCloud.ClusterInspectAdditionalAction", "azure.mgmt.networkcloud.models.ClusterScanRuntimeParametersScanActivity": "Microsoft.NetworkCloud.ClusterScanRuntimeParametersScanActivity", + "azure.mgmt.networkcloud.models.ClusterUpdateVersionSafeguardMode": "Microsoft.NetworkCloud.ClusterUpdateVersionSafeguardMode", "azure.mgmt.networkcloud.models.HugepagesSize": "Microsoft.NetworkCloud.HugepagesSize", "azure.mgmt.networkcloud.models.KubernetesPluginType": "Microsoft.NetworkCloud.KubernetesPluginType", "azure.mgmt.networkcloud.models.L3NetworkConfigurationIpamEnabled": "Microsoft.NetworkCloud.L3NetworkConfigurationIpamEnabled", @@ -233,6 +268,7 @@ "azure.mgmt.networkcloud.models.KubernetesNodePowerState": "Microsoft.NetworkCloud.KubernetesNodePowerState", "azure.mgmt.networkcloud.models.KubernetesNodeRole": "Microsoft.NetworkCloud.KubernetesNodeRole", "azure.mgmt.networkcloud.models.KubernetesClusterProvisioningState": "Microsoft.NetworkCloud.KubernetesClusterProvisioningState", + "azure.mgmt.networkcloud.models.KubernetesVersionProvisioningState": "Microsoft.NetworkCloud.KubernetesVersionProvisioningState", "azure.mgmt.networkcloud.models.HybridAksPluginType": "Microsoft.NetworkCloud.HybridAksPluginType", "azure.mgmt.networkcloud.models.L2NetworkDetailedStatus": "Microsoft.NetworkCloud.L2NetworkDetailedStatus", "azure.mgmt.networkcloud.models.L2NetworkProvisioningState": "Microsoft.NetworkCloud.L2NetworkProvisioningState", @@ -249,6 +285,8 @@ "azure.mgmt.networkcloud.models.RackDetailedStatus": "Microsoft.NetworkCloud.RackDetailedStatus", "azure.mgmt.networkcloud.models.RackProvisioningState": "Microsoft.NetworkCloud.RackProvisioningState", "azure.mgmt.networkcloud.models.StorageApplianceDetailedStatus": "Microsoft.NetworkCloud.StorageApplianceDetailedStatus", + "azure.mgmt.networkcloud.models.StorageApplianceMetricsConfigurationStatusLogLevel": "Microsoft.NetworkCloud.StorageApplianceMetricsConfigurationStatusLogLevel", + "azure.mgmt.networkcloud.models.StorageApplianceMetricsConfigurationStatusMetricsLevel": "Microsoft.NetworkCloud.StorageApplianceMetricsConfigurationStatusMetricsLevel", "azure.mgmt.networkcloud.models.RemoteVendorManagementFeature": "Microsoft.NetworkCloud.RemoteVendorManagementFeature", "azure.mgmt.networkcloud.models.RemoteVendorManagementStatus": "Microsoft.NetworkCloud.RemoteVendorManagementStatus", "azure.mgmt.networkcloud.models.StorageApplianceProvisioningState": "Microsoft.NetworkCloud.StorageApplianceProvisioningState", @@ -290,6 +328,18 @@ "azure.mgmt.networkcloud.models.ClusterMetricsConfigurationProvisioningState": "Microsoft.NetworkCloud.ClusterMetricsConfigurationProvisioningState", "azure.mgmt.networkcloud.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.networkcloud.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.networkcloud.operations.AccessBridgesOperations.get": "Microsoft.NetworkCloud.AccessBridges.get", + "azure.mgmt.networkcloud.aio.operations.AccessBridgesOperations.get": "Microsoft.NetworkCloud.AccessBridges.get", + "azure.mgmt.networkcloud.operations.AccessBridgesOperations.begin_create_or_update": "Microsoft.NetworkCloud.AccessBridges.createOrUpdate", + "azure.mgmt.networkcloud.aio.operations.AccessBridgesOperations.begin_create_or_update": "Microsoft.NetworkCloud.AccessBridges.createOrUpdate", + "azure.mgmt.networkcloud.operations.AccessBridgesOperations.begin_update": "Microsoft.NetworkCloud.AccessBridges.update", + "azure.mgmt.networkcloud.aio.operations.AccessBridgesOperations.begin_update": "Microsoft.NetworkCloud.AccessBridges.update", + "azure.mgmt.networkcloud.operations.AccessBridgesOperations.begin_delete": "Microsoft.NetworkCloud.AccessBridges.delete", + "azure.mgmt.networkcloud.aio.operations.AccessBridgesOperations.begin_delete": "Microsoft.NetworkCloud.AccessBridges.delete", + "azure.mgmt.networkcloud.operations.AccessBridgesOperations.list_by_resource_group": "Microsoft.NetworkCloud.AccessBridges.listByResourceGroup", + "azure.mgmt.networkcloud.aio.operations.AccessBridgesOperations.list_by_resource_group": "Microsoft.NetworkCloud.AccessBridges.listByResourceGroup", + "azure.mgmt.networkcloud.operations.AccessBridgesOperations.list_by_subscription": "Microsoft.NetworkCloud.AccessBridges.listBySubscription", + "azure.mgmt.networkcloud.aio.operations.AccessBridgesOperations.list_by_subscription": "Microsoft.NetworkCloud.AccessBridges.listBySubscription", "azure.mgmt.networkcloud.operations.BareMetalMachinesOperations.get": "Microsoft.NetworkCloud.BareMetalMachines.get", "azure.mgmt.networkcloud.aio.operations.BareMetalMachinesOperations.get": "Microsoft.NetworkCloud.BareMetalMachines.get", "azure.mgmt.networkcloud.operations.BareMetalMachinesOperations.begin_create_or_update": "Microsoft.NetworkCloud.BareMetalMachines.createOrUpdate", @@ -348,6 +398,8 @@ "azure.mgmt.networkcloud.aio.operations.ClusterManagersOperations.list_by_resource_group": "Microsoft.NetworkCloud.ClusterManagers.listByResourceGroup", "azure.mgmt.networkcloud.operations.ClusterManagersOperations.list_by_subscription": "Microsoft.NetworkCloud.ClusterManagers.listBySubscription", "azure.mgmt.networkcloud.aio.operations.ClusterManagersOperations.list_by_subscription": "Microsoft.NetworkCloud.ClusterManagers.listBySubscription", + "azure.mgmt.networkcloud.operations.ClusterManagersOperations.begin_update_relay_private_endpoint_connection": "Microsoft.NetworkCloud.ClusterManagers.updateRelayPrivateEndpointConnection", + "azure.mgmt.networkcloud.aio.operations.ClusterManagersOperations.begin_update_relay_private_endpoint_connection": "Microsoft.NetworkCloud.ClusterManagers.updateRelayPrivateEndpointConnection", "azure.mgmt.networkcloud.operations.ClustersOperations.get": "Microsoft.NetworkCloud.Clusters.get", "azure.mgmt.networkcloud.aio.operations.ClustersOperations.get": "Microsoft.NetworkCloud.Clusters.get", "azure.mgmt.networkcloud.operations.ClustersOperations.begin_create_or_update": "Microsoft.NetworkCloud.Clusters.createOrUpdate", @@ -364,6 +416,10 @@ "azure.mgmt.networkcloud.aio.operations.ClustersOperations.begin_continue_update_version": "Microsoft.NetworkCloud.Clusters.continueUpdateVersion", "azure.mgmt.networkcloud.operations.ClustersOperations.begin_deploy": "Microsoft.NetworkCloud.Clusters.deploy", "azure.mgmt.networkcloud.aio.operations.ClustersOperations.begin_deploy": "Microsoft.NetworkCloud.Clusters.deploy", + "azure.mgmt.networkcloud.operations.ClustersOperations.begin_inspect": "Microsoft.NetworkCloud.Clusters.inspect", + "azure.mgmt.networkcloud.aio.operations.ClustersOperations.begin_inspect": "Microsoft.NetworkCloud.Clusters.inspect", + "azure.mgmt.networkcloud.operations.ClustersOperations.begin_rotate_credential": "Microsoft.NetworkCloud.Clusters.rotateCredential", + "azure.mgmt.networkcloud.aio.operations.ClustersOperations.begin_rotate_credential": "Microsoft.NetworkCloud.Clusters.rotateCredential", "azure.mgmt.networkcloud.operations.ClustersOperations.begin_scan_runtime": "Microsoft.NetworkCloud.Clusters.scanRuntime", "azure.mgmt.networkcloud.aio.operations.ClustersOperations.begin_scan_runtime": "Microsoft.NetworkCloud.Clusters.scanRuntime", "azure.mgmt.networkcloud.operations.ClustersOperations.begin_update_version": "Microsoft.NetworkCloud.Clusters.updateVersion", @@ -382,6 +438,18 @@ "azure.mgmt.networkcloud.aio.operations.KubernetesClustersOperations.list_by_subscription": "Microsoft.NetworkCloud.KubernetesClusters.listBySubscription", "azure.mgmt.networkcloud.operations.KubernetesClustersOperations.begin_restart_node": "Microsoft.NetworkCloud.KubernetesClusters.restartNode", "azure.mgmt.networkcloud.aio.operations.KubernetesClustersOperations.begin_restart_node": "Microsoft.NetworkCloud.KubernetesClusters.restartNode", + "azure.mgmt.networkcloud.operations.KubernetesVersionsOperations.get": "Microsoft.NetworkCloud.KubernetesVersions.get", + "azure.mgmt.networkcloud.aio.operations.KubernetesVersionsOperations.get": "Microsoft.NetworkCloud.KubernetesVersions.get", + "azure.mgmt.networkcloud.operations.KubernetesVersionsOperations.begin_create_or_update": "Microsoft.NetworkCloud.KubernetesVersions.createOrUpdate", + "azure.mgmt.networkcloud.aio.operations.KubernetesVersionsOperations.begin_create_or_update": "Microsoft.NetworkCloud.KubernetesVersions.createOrUpdate", + "azure.mgmt.networkcloud.operations.KubernetesVersionsOperations.begin_update": "Microsoft.NetworkCloud.KubernetesVersions.update", + "azure.mgmt.networkcloud.aio.operations.KubernetesVersionsOperations.begin_update": "Microsoft.NetworkCloud.KubernetesVersions.update", + "azure.mgmt.networkcloud.operations.KubernetesVersionsOperations.begin_delete": "Microsoft.NetworkCloud.KubernetesVersions.delete", + "azure.mgmt.networkcloud.aio.operations.KubernetesVersionsOperations.begin_delete": "Microsoft.NetworkCloud.KubernetesVersions.delete", + "azure.mgmt.networkcloud.operations.KubernetesVersionsOperations.list_by_resource_group": "Microsoft.NetworkCloud.KubernetesVersions.listByResourceGroup", + "azure.mgmt.networkcloud.aio.operations.KubernetesVersionsOperations.list_by_resource_group": "Microsoft.NetworkCloud.KubernetesVersions.listByResourceGroup", + "azure.mgmt.networkcloud.operations.KubernetesVersionsOperations.list_by_subscription": "Microsoft.NetworkCloud.KubernetesVersions.listBySubscription", + "azure.mgmt.networkcloud.aio.operations.KubernetesVersionsOperations.list_by_subscription": "Microsoft.NetworkCloud.KubernetesVersions.listBySubscription", "azure.mgmt.networkcloud.operations.L2NetworksOperations.get": "Microsoft.NetworkCloud.L2Networks.get", "azure.mgmt.networkcloud.aio.operations.L2NetworksOperations.get": "Microsoft.NetworkCloud.L2Networks.get", "azure.mgmt.networkcloud.operations.L2NetworksOperations.begin_create_or_update": "Microsoft.NetworkCloud.L2Networks.createOrUpdate", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_client.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_client.py index eb6dab1a8ea0..99500de80415 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_client.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_client.py @@ -20,6 +20,7 @@ from ._configuration import NetworkCloudMgmtClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( + AccessBridgesOperations, AgentPoolsOperations, BareMetalMachineKeySetsOperations, BareMetalMachinesOperations, @@ -30,6 +31,7 @@ ConsolesOperations, KubernetesClusterFeaturesOperations, KubernetesClustersOperations, + KubernetesVersionsOperations, L2NetworksOperations, L3NetworksOperations, MetricsConfigurationsOperations, @@ -53,6 +55,8 @@ class NetworkCloudMgmtClient: # pylint: disable=too-many-instance-attributes :ivar operations: Operations operations :vartype operations: azure.mgmt.networkcloud.operations.Operations + :ivar access_bridges: AccessBridgesOperations operations + :vartype access_bridges: azure.mgmt.networkcloud.operations.AccessBridgesOperations :ivar bare_metal_machines: BareMetalMachinesOperations operations :vartype bare_metal_machines: azure.mgmt.networkcloud.operations.BareMetalMachinesOperations :ivar cloud_services_networks: CloudServicesNetworksOperations operations @@ -64,6 +68,8 @@ class NetworkCloudMgmtClient: # pylint: disable=too-many-instance-attributes :vartype clusters: azure.mgmt.networkcloud.operations.ClustersOperations :ivar kubernetes_clusters: KubernetesClustersOperations operations :vartype kubernetes_clusters: azure.mgmt.networkcloud.operations.KubernetesClustersOperations + :ivar kubernetes_versions: KubernetesVersionsOperations operations + :vartype kubernetes_versions: azure.mgmt.networkcloud.operations.KubernetesVersionsOperations :ivar l2_networks: L2NetworksOperations operations :vartype l2_networks: azure.mgmt.networkcloud.operations.L2NetworksOperations :ivar l3_networks: L3NetworksOperations operations @@ -104,9 +110,9 @@ class NetworkCloudMgmtClient: # 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 "2025-09-01". - Default value is "2025-09-01". 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-05-01-preview". Default value is "2026-05-01-preview". 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. @@ -160,6 +166,7 @@ def __init__( self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.access_bridges = AccessBridgesOperations(self._client, self._config, self._serialize, self._deserialize) self.bare_metal_machines = BareMetalMachinesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -173,6 +180,9 @@ def __init__( self.kubernetes_clusters = KubernetesClustersOperations( self._client, self._config, self._serialize, self._deserialize ) + self.kubernetes_versions = KubernetesVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.l2_networks = L2NetworksOperations(self._client, self._config, self._serialize, self._deserialize) self.l3_networks = L3NetworksOperations(self._client, self._config, self._serialize, self._deserialize) self.rack_skus = RackSkusOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_configuration.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_configuration.py index eb7848c77ba0..a517253da0df 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_configuration.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_configuration.py @@ -33,9 +33,9 @@ class NetworkCloudMgmtClientConfiguration: # pylint: disable=too-many-instance- :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 "2025-09-01". - Default value is "2025-09-01". 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-05-01-preview". Default value is "2026-05-01-preview". 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", "2025-09-01") + api_version: str = kwargs.pop("api_version", "2026-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_utils/model_base.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_utils/model_base.py index 7b7f8ba67b53..eef4e52ed1a0 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_utils/model_base.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_utils/model_base.py @@ -600,57 +600,9 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: for rest_field in self._attr_to_rest_field.values() if rest_field._default is not _UNSET } - if args: # pylint: disable=too-many-nested-blocks + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -669,6 +621,69 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: ) super().__init__(dict_to_pass) + def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + model_meta = getattr(self, "_xml", {}) + existed_attr_keys: list[str] = [] + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -693,6 +708,10 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._attr_to_rest_field.items() + } cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -702,6 +721,16 @@ def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: if hasattr(base, "__mapping__"): base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: for v in cls.__dict__.values(): @@ -721,7 +750,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -1067,6 +1096,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, ): self._type = type self._rest_name_input = name @@ -1079,6 +1109,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._original_tsp_name = original_tsp_name @property def _class_type(self) -> typing.Any: @@ -1157,6 +1188,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, ) -> typing.Any: return _RestField( name=name, @@ -1166,6 +1198,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + original_tsp_name=original_tsp_name, ) @@ -1190,6 +1223,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1201,10 +1284,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1226,7 +1315,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1238,12 +1329,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1252,6 +1338,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1259,7 +1346,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1268,13 +1355,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1286,8 +1376,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1308,11 +1399,29 @@ def _get_primitive_type_value(v) -> str: return str(v) +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + def _create_xml_element( tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None ) -> ET.Element: if prefix and ns: - ET.register_namespace(prefix, ns) + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_validation.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# 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 functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_version.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_version.py index fd5e9189cf06..6683b975dd63 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_version.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0b1" +VERSION = "3.0.0b2" diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/_client.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/_client.py index 04d04a9dc89f..7c91670f2e3a 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/_client.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/_client.py @@ -20,6 +20,7 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import NetworkCloudMgmtClientConfiguration from .operations import ( + AccessBridgesOperations, AgentPoolsOperations, BareMetalMachineKeySetsOperations, BareMetalMachinesOperations, @@ -30,6 +31,7 @@ ConsolesOperations, KubernetesClusterFeaturesOperations, KubernetesClustersOperations, + KubernetesVersionsOperations, L2NetworksOperations, L3NetworksOperations, MetricsConfigurationsOperations, @@ -53,6 +55,8 @@ class NetworkCloudMgmtClient: # pylint: disable=too-many-instance-attributes :ivar operations: Operations operations :vartype operations: azure.mgmt.networkcloud.aio.operations.Operations + :ivar access_bridges: AccessBridgesOperations operations + :vartype access_bridges: azure.mgmt.networkcloud.aio.operations.AccessBridgesOperations :ivar bare_metal_machines: BareMetalMachinesOperations operations :vartype bare_metal_machines: azure.mgmt.networkcloud.aio.operations.BareMetalMachinesOperations @@ -66,6 +70,9 @@ class NetworkCloudMgmtClient: # pylint: disable=too-many-instance-attributes :ivar kubernetes_clusters: KubernetesClustersOperations operations :vartype kubernetes_clusters: azure.mgmt.networkcloud.aio.operations.KubernetesClustersOperations + :ivar kubernetes_versions: KubernetesVersionsOperations operations + :vartype kubernetes_versions: + azure.mgmt.networkcloud.aio.operations.KubernetesVersionsOperations :ivar l2_networks: L2NetworksOperations operations :vartype l2_networks: azure.mgmt.networkcloud.aio.operations.L2NetworksOperations :ivar l3_networks: L3NetworksOperations operations @@ -106,9 +113,9 @@ class NetworkCloudMgmtClient: # 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 "2025-09-01". - Default value is "2025-09-01". 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-05-01-preview". Default value is "2026-05-01-preview". 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. @@ -164,6 +171,7 @@ def __init__( self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.access_bridges = AccessBridgesOperations(self._client, self._config, self._serialize, self._deserialize) self.bare_metal_machines = BareMetalMachinesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -177,6 +185,9 @@ def __init__( self.kubernetes_clusters = KubernetesClustersOperations( self._client, self._config, self._serialize, self._deserialize ) + self.kubernetes_versions = KubernetesVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.l2_networks = L2NetworksOperations(self._client, self._config, self._serialize, self._deserialize) self.l3_networks = L3NetworksOperations(self._client, self._config, self._serialize, self._deserialize) self.rack_skus = RackSkusOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/_configuration.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/_configuration.py index d35964fd8912..8a9e429fe700 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/_configuration.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/_configuration.py @@ -33,9 +33,9 @@ class NetworkCloudMgmtClientConfiguration: # pylint: disable=too-many-instance- :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 "2025-09-01". - Default value is "2025-09-01". 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-05-01-preview". Default value is "2026-05-01-preview". 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", "2025-09-01") + api_version: str = kwargs.pop("api_version", "2026-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/operations/__init__.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/operations/__init__.py index a3eb236d5878..d49d351ab326 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/operations/__init__.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/operations/__init__.py @@ -13,11 +13,13 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore +from ._operations import AccessBridgesOperations # type: ignore from ._operations import BareMetalMachinesOperations # type: ignore from ._operations import CloudServicesNetworksOperations # type: ignore from ._operations import ClusterManagersOperations # type: ignore from ._operations import ClustersOperations # type: ignore from ._operations import KubernetesClustersOperations # type: ignore +from ._operations import KubernetesVersionsOperations # type: ignore from ._operations import L2NetworksOperations # type: ignore from ._operations import L3NetworksOperations # type: ignore from ._operations import RackSkusOperations # type: ignore @@ -39,11 +41,13 @@ __all__ = [ "Operations", + "AccessBridgesOperations", "BareMetalMachinesOperations", "CloudServicesNetworksOperations", "ClusterManagersOperations", "ClustersOperations", "KubernetesClustersOperations", + "KubernetesVersionsOperations", "L2NetworksOperations", "L3NetworksOperations", "RackSkusOperations", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/operations/_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/operations/_operations.py index 5b9227aaff1c..a8a6d8d24538 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/operations/_operations.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/aio/operations/_operations.py @@ -37,7 +37,14 @@ from ... import models as _models from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation from ...operations._operations import ( + build_access_bridges_create_or_update_request, + build_access_bridges_delete_request, + build_access_bridges_get_request, + build_access_bridges_list_by_resource_group_request, + build_access_bridges_list_by_subscription_request, + build_access_bridges_update_request, build_agent_pools_create_or_update_request, build_agent_pools_delete_request, build_agent_pools_get_request, @@ -81,14 +88,17 @@ build_cluster_managers_get_request, build_cluster_managers_list_by_resource_group_request, build_cluster_managers_list_by_subscription_request, + build_cluster_managers_update_relay_private_endpoint_connection_request, build_cluster_managers_update_request, build_clusters_continue_update_version_request, build_clusters_create_or_update_request, build_clusters_delete_request, build_clusters_deploy_request, build_clusters_get_request, + build_clusters_inspect_request, build_clusters_list_by_resource_group_request, build_clusters_list_by_subscription_request, + build_clusters_rotate_credential_request, build_clusters_scan_runtime_request, build_clusters_update_request, build_clusters_update_version_request, @@ -109,6 +119,12 @@ build_kubernetes_clusters_list_by_subscription_request, build_kubernetes_clusters_restart_node_request, build_kubernetes_clusters_update_request, + build_kubernetes_versions_create_or_update_request, + build_kubernetes_versions_delete_request, + build_kubernetes_versions_get_request, + build_kubernetes_versions_list_by_resource_group_request, + build_kubernetes_versions_list_by_subscription_request, + build_kubernetes_versions_update_request, build_l2_networks_create_or_update_request, build_l2_networks_delete_request, build_l2_networks_get_request, @@ -283,14 +299,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class BareMetalMachinesOperations: # pylint: disable=too-many-public-methods +class AccessBridgesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.networkcloud.aio.NetworkCloudMgmtClient`'s - :attr:`bare_metal_machines` attribute. + :attr:`access_bridges` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -301,18 +317,32 @@ 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-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def get( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any - ) -> _models.BareMetalMachine: - """Get properties of the provided bare metal machine. + self, resource_group_name: str, access_bridge_name: Union[str, _models.AccessBridgeAllowedName], **kwargs: Any + ) -> _models.AccessBridge: + """Get the properties of the provided access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :return: BareMetalMachine. The BareMetalMachine is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.BareMetalMachine + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :return: AccessBridge. The AccessBridge is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.AccessBridge :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -326,11 +356,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.BareMetalMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.AccessBridge] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_get_request( + _request = build_access_bridges_get_request( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -365,21 +395,32 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.BareMetalMachine, response.json()) + deserialized = _deserialize(_models.AccessBridge, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def _create_or_update_initial( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: Union[_models.BareMetalMachine, JSON, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: Union[_models.AccessBridge, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -388,12 +429,6 @@ async def _create_or_update_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -404,17 +439,15 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(bare_metal_machine_parameters, (IOBase, bytes)): - _content = bare_metal_machine_parameters + if isinstance(access_bridge, (IOBase, bytes)): + _content = access_bridge else: - _content = json.dumps(bare_metal_machine_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(access_bridge, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_bare_metal_machines_create_or_update_request( + _request = build_access_bridges_create_or_update_request( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -463,36 +496,28 @@ async def _create_or_update_initial( async def begin_create_or_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: _models.BareMetalMachine, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: _models.AccessBridge, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.BareMetalMachine]: - """Create a new bare metal machine or update the properties of the existing one. All customer - initiated requests will be rejected as the life cycle of this resource is managed by the - system. + ) -> AsyncLROPoller[_models.AccessBridge]: + """Create a new access bridge or update the properties of the existing access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_parameters: The request body. Required. - :type bare_metal_machine_parameters: ~azure.mgmt.networkcloud.models.BareMetalMachine + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge: The access bridge configuration. Required. + :type access_bridge: ~azure.mgmt.networkcloud.models.AccessBridge :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + :return: An instance of AsyncLROPoller that returns AccessBridge. The AccessBridge is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -500,36 +525,28 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: JSON, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: JSON, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.BareMetalMachine]: - """Create a new bare metal machine or update the properties of the existing one. All customer - initiated requests will be rejected as the life cycle of this resource is managed by the - system. + ) -> AsyncLROPoller[_models.AccessBridge]: + """Create a new access bridge or update the properties of the existing access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_parameters: The request body. Required. - :type bare_metal_machine_parameters: JSON + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge: The access bridge configuration. Required. + :type access_bridge: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + :return: An instance of AsyncLROPoller that returns AccessBridge. The AccessBridge is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -537,88 +554,82 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: IO[bytes], + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.BareMetalMachine]: - """Create a new bare metal machine or update the properties of the existing one. All customer - initiated requests will be rejected as the life cycle of this resource is managed by the - system. + ) -> AsyncLROPoller[_models.AccessBridge]: + """Create a new access bridge or update the properties of the existing access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_parameters: The request body. Required. - :type bare_metal_machine_parameters: IO[bytes] + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge: The access bridge configuration. Required. + :type access_bridge: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + :return: An instance of AsyncLROPoller that returns AccessBridge. The AccessBridge is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def begin_create_or_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: Union[_models.BareMetalMachine, JSON, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: Union[_models.AccessBridge, JSON, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.BareMetalMachine]: - """Create a new bare metal machine or update the properties of the existing one. All customer - initiated requests will be rejected as the life cycle of this resource is managed by the - system. + ) -> AsyncLROPoller[_models.AccessBridge]: + """Create a new access bridge or update the properties of the existing access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_parameters: The request body. Is one of the following types: - BareMetalMachine, JSON, IO[bytes] Required. - :type bare_metal_machine_parameters: ~azure.mgmt.networkcloud.models.BareMetalMachine or JSON - or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge: The access bridge configuration. Is one of the following types: + AccessBridge, JSON, IO[bytes] Required. + :type access_bridge: ~azure.mgmt.networkcloud.models.AccessBridge or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns AccessBridge. The AccessBridge is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :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.BareMetalMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.AccessBridge] = 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, - bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_parameters=bare_metal_machine_parameters, - etag=etag, - match_condition=match_condition, + access_bridge_name=access_bridge_name, + access_bridge=access_bridge, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -630,7 +641,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.BareMetalMachine, response.json()) + deserialized = _deserialize(_models.AccessBridge, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -648,23 +659,37 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.BareMetalMachine].from_continuation_token( + return AsyncLROPoller[_models.AccessBridge].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.BareMetalMachine]( + return AsyncLROPoller[_models.AccessBridge]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def _update_initial( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[ - Union[_models.BareMetalMachinePatchParameters, JSON, IO[bytes]] - ] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[Union[_models.AccessBridgePatchParameters, JSON, IO[bytes]]] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -688,22 +713,22 @@ async def _update_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if bare_metal_machine_update_parameters else None + content_type = content_type if access_bridge_update_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if bare_metal_machine_update_parameters else None + content_type = content_type or "application/json" if access_bridge_update_parameters else None _content = None - if isinstance(bare_metal_machine_update_parameters, (IOBase, bytes)): - _content = bare_metal_machine_update_parameters + if isinstance(access_bridge_update_parameters, (IOBase, bytes)): + _content = access_bridge_update_parameters else: - if bare_metal_machine_update_parameters is not None: - _content = json.dumps(bare_metal_machine_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if access_bridge_update_parameters is not None: + _content = json.dumps(access_bridge_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_bare_metal_machines_update_request( + _request = build_access_bridges_update_request( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -756,25 +781,26 @@ async def _update_initial( async def begin_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[_models.BareMetalMachinePatchParameters] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[_models.AccessBridgePatchParameters] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.BareMetalMachine]: - """Patch properties of the provided bare metal machine, or update tags associated with the bare - metal machine. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.AccessBridge]: + """Update properties of the provided access bridge, or update tags associated with the access + bridge. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_update_parameters: The request body. Default value is None. - :type bare_metal_machine_update_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge_update_parameters: The request body. Default value is None. + :type access_bridge_update_parameters: + ~azure.mgmt.networkcloud.models.AccessBridgePatchParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -783,9 +809,9 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + :return: An instance of AsyncLROPoller that returns AccessBridge. The AccessBridge is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -793,24 +819,25 @@ async def begin_update( async def begin_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[JSON] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.BareMetalMachine]: - """Patch properties of the provided bare metal machine, or update tags associated with the bare - metal machine. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.AccessBridge]: + """Update properties of the provided access bridge, or update tags associated with the access + bridge. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_update_parameters: The request body. Default value is None. - :type bare_metal_machine_update_parameters: JSON + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge_update_parameters: The request body. Default value is None. + :type access_bridge_update_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -819,9 +846,9 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + :return: An instance of AsyncLROPoller that returns AccessBridge. The AccessBridge is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -829,24 +856,25 @@ async def begin_update( async def begin_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[IO[bytes]] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.BareMetalMachine]: - """Patch properties of the provided bare metal machine, or update tags associated with the bare - metal machine. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.AccessBridge]: + """Update properties of the provided access bridge, or update tags associated with the access + bridge. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_update_parameters: The request body. Default value is None. - :type bare_metal_machine_update_parameters: IO[bytes] + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge_update_parameters: The request body. Default value is None. + :type access_bridge_update_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 @@ -855,61 +883,76 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + :return: An instance of AsyncLROPoller that returns AccessBridge. The AccessBridge is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def begin_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[ - Union[_models.BareMetalMachinePatchParameters, JSON, IO[bytes]] - ] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[Union[_models.AccessBridgePatchParameters, JSON, IO[bytes]]] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.BareMetalMachine]: - """Patch properties of the provided bare metal machine, or update tags associated with the bare - metal machine. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.AccessBridge]: + """Update properties of the provided access bridge, or update tags associated with the access + bridge. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_update_parameters: The request body. Is one of the following types: - BareMetalMachinePatchParameters, JSON, IO[bytes] Default value is None. - :type bare_metal_machine_update_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters or JSON or IO[bytes] + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge_update_parameters: The request body. Is one of the following types: + AccessBridgePatchParameters, JSON, IO[bytes] Default value is None. + :type access_bridge_update_parameters: + ~azure.mgmt.networkcloud.models.AccessBridgePatchParameters or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + :return: An instance of AsyncLROPoller that returns AccessBridge. The AccessBridge is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :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)) - content_type = content_type if bare_metal_machine_update_parameters else None - cls: ClsType[_models.BareMetalMachine] = kwargs.pop("cls", None) + content_type = content_type if access_bridge_update_parameters else None + cls: ClsType[_models.AccessBridge] = 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, - bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_update_parameters=bare_metal_machine_update_parameters, + access_bridge_name=access_bridge_name, + access_bridge_update_parameters=access_bridge_update_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -923,7 +966,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.BareMetalMachine, response.json()) + deserialized = _deserialize(_models.AccessBridge, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -941,20 +984,34 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.BareMetalMachine].from_continuation_token( + return AsyncLROPoller[_models.AccessBridge].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.BareMetalMachine]( + return AsyncLROPoller[_models.AccessBridge]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def _delete_initial( self, resource_group_name: str, - bare_metal_machine_name: str, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -979,9 +1036,9 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_delete_request( + _request = build_access_bridges_delete_request( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -1026,23 +1083,37 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def begin_delete( self, resource_group_name: str, - bare_metal_machine_name: str, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Delete the provided bare metal machine. All customer initiated requests will be rejected as the - life cycle of this resource is managed by the system. + """Delete the specified access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -1064,7 +1135,7 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, etag=etag, match_condition=match_condition, cls=lambda x, y, z: x, @@ -1109,10 +1180,24 @@ def get_long_running_output(pipeline_response): ) @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "top", + "skip_token", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def list_by_resource_group( self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.BareMetalMachine"]: - """Get a list of bare metal machines in the provided resource group. + ) -> AsyncItemPaged["_models.AccessBridge"]: + """Get a list of access bridges in the provided resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1124,15 +1209,14 @@ def list_by_resource_group( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of BareMetalMachine - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An iterator like instance of AccessBridge + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.BareMetalMachine]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AccessBridge]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1145,7 +1229,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_bare_metal_machines_list_by_resource_group_request( + _request = build_access_bridges_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, top=top, @@ -1186,7 +1270,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.BareMetalMachine], + List[_models.AccessBridge], deserialized.get("value", []), ) if cls: @@ -1215,10 +1299,15 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={"2026-01-01-preview": ["api_version", "subscription_id", "top", "skip_token", "accept"]}, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def list_by_subscription( self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.BareMetalMachine"]: - """Get a list of bare metal machines in the provided subscription. + ) -> AsyncItemPaged["_models.AccessBridge"]: + """Get a list of access bridges in the provided subscription. :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -1227,15 +1316,14 @@ def list_by_subscription( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of BareMetalMachine - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An iterator like instance of AccessBridge + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.BareMetalMachine]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AccessBridge]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1248,7 +1336,7 @@ def list_by_subscription( def prepare_request(next_link=None): if not next_link: - _request = build_bare_metal_machines_list_by_subscription_request( + _request = build_access_bridges_list_by_subscription_request( subscription_id=self._config.subscription_id, top=top, skip_token=skip_token, @@ -1288,7 +1376,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.BareMetalMachine], + List[_models.AccessBridge], deserialized.get("value", []), ) if cls: @@ -1316,15 +1404,39 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - async def _cordon_initial( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[ - Union[_models.BareMetalMachineCordonParameters, JSON, IO[bytes]] - ] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: + +class BareMetalMachinesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.networkcloud.aio.NetworkCloudMgmtClient`'s + :attr:`bare_metal_machines` 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: NetworkCloudMgmtClientConfiguration = 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, bare_metal_machine_name: str, **kwargs: Any + ) -> _models.BareMetalMachine: + """Get properties of the provided bare metal machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :return: BareMetalMachine. The BareMetalMachine is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.BareMetalMachine + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1333,27 +1445,98 @@ async def _cordon_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)) - content_type = content_type if bare_metal_machine_cordon_parameters else None + cls: ClsType[_models.BareMetalMachine] = kwargs.pop("cls", None) + + _request = build_bare_metal_machines_get_request( + resource_group_name=resource_group_name, + bare_metal_machine_name=bare_metal_machine_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.BareMetalMachine, 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, + bare_metal_machine_name: str, + bare_metal_machine_parameters: Union[_models.BareMetalMachine, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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" if bare_metal_machine_cordon_parameters else None + content_type = content_type or "application/json" _content = None - if isinstance(bare_metal_machine_cordon_parameters, (IOBase, bytes)): - _content = bare_metal_machine_cordon_parameters + if isinstance(bare_metal_machine_parameters, (IOBase, bytes)): + _content = bare_metal_machine_parameters else: - if bare_metal_machine_cordon_parameters is not None: - _content = json.dumps(bare_metal_machine_cordon_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + _content = json.dumps(bare_metal_machine_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_bare_metal_machines_cordon_request( + _request = build_bare_metal_machines_create_or_update_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1373,7 +1556,7 @@ async def _cordon_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1386,8 +1569,10 @@ async def _cordon_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -1397,134 +1582,165 @@ async def _cordon_initial( return deserialized # type: ignore @overload - async def begin_cordon( + async def begin_create_or_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[_models.BareMetalMachineCordonParameters] = None, + bare_metal_machine_parameters: _models.BareMetalMachine, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Cordon the provided bare metal machine's Kubernetes node. + ) -> AsyncLROPoller[_models.BareMetalMachine]: + """Create a new bare metal machine or update the properties of the existing one. All customer + initiated requests will be rejected as the life cycle of this resource is managed by the + system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_cordon_parameters: The request body. Default value is None. - :type bare_metal_machine_cordon_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineCordonParameters + :param bare_metal_machine_parameters: The request body. Required. + :type bare_metal_machine_parameters: ~azure.mgmt.networkcloud.models.BareMetalMachine :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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_cordon( + async def begin_create_or_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[JSON] = None, + bare_metal_machine_parameters: JSON, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Cordon the provided bare metal machine's Kubernetes node. + ) -> AsyncLROPoller[_models.BareMetalMachine]: + """Create a new bare metal machine or update the properties of the existing one. All customer + initiated requests will be rejected as the life cycle of this resource is managed by the + system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_cordon_parameters: The request body. Default value is None. - :type bare_metal_machine_cordon_parameters: JSON + :param bare_metal_machine_parameters: The request body. Required. + :type bare_metal_machine_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_cordon( + async def begin_create_or_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[IO[bytes]] = None, + bare_metal_machine_parameters: IO[bytes], *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Cordon the provided bare metal machine's Kubernetes node. + ) -> AsyncLROPoller[_models.BareMetalMachine]: + """Create a new bare metal machine or update the properties of the existing one. All customer + initiated requests will be rejected as the life cycle of this resource is managed by the + system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_cordon_parameters: The request body. Default value is None. - :type bare_metal_machine_cordon_parameters: IO[bytes] + :param bare_metal_machine_parameters: The request body. Required. + :type bare_metal_machine_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_cordon( + async def begin_create_or_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[ - Union[_models.BareMetalMachineCordonParameters, JSON, IO[bytes]] - ] = None, + bare_metal_machine_parameters: Union[_models.BareMetalMachine, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Cordon the provided bare metal machine's Kubernetes node. + ) -> AsyncLROPoller[_models.BareMetalMachine]: + """Create a new bare metal machine or update the properties of the existing one. All customer + initiated requests will be rejected as the life cycle of this resource is managed by the + system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_cordon_parameters: The request body. Is one of the following types: - BareMetalMachineCordonParameters, JSON, IO[bytes] Default value is None. - :type bare_metal_machine_cordon_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineCordonParameters or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :param bare_metal_machine_parameters: The request body. Is one of the following types: + BareMetalMachine, JSON, IO[bytes] Required. + :type bare_metal_machine_parameters: ~azure.mgmt.networkcloud.models.BareMetalMachine or JSON + or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :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)) - content_type = content_type if bare_metal_machine_cordon_parameters else None - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + cls: ClsType[_models.BareMetalMachine] = 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._cordon_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_cordon_parameters=bare_metal_machine_cordon_parameters, + bare_metal_machine_parameters=bare_metal_machine_parameters, + etag=etag, + match_condition=match_condition, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -1535,14 +1751,10 @@ async def begin_cordon( 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.OperationStatusResult, response.json()) + deserialized = _deserialize(_models.BareMetalMachine, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -1558,23 +1770,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + return AsyncLROPoller[_models.BareMetalMachine].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.OperationStatusResult]( + return AsyncLROPoller[_models.BareMetalMachine]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _power_off_initial( + async def _update_initial( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[ - Union[_models.BareMetalMachinePowerOffParameters, JSON, IO[bytes]] + bare_metal_machine_update_parameters: Optional[ + Union[_models.BareMetalMachinePatchParameters, JSON, IO[bytes]] ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1583,29 +1798,37 @@ async def _power_off_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError 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)) - content_type = content_type if bare_metal_machine_power_off_parameters else None + content_type = content_type if bare_metal_machine_update_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if bare_metal_machine_power_off_parameters else None + content_type = content_type or "application/json" if bare_metal_machine_update_parameters else None _content = None - if isinstance(bare_metal_machine_power_off_parameters, (IOBase, bytes)): - _content = bare_metal_machine_power_off_parameters + if isinstance(bare_metal_machine_update_parameters, (IOBase, bytes)): + _content = bare_metal_machine_update_parameters else: - if bare_metal_machine_power_off_parameters is not None: - _content = json.dumps(bare_metal_machine_power_off_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if bare_metal_machine_update_parameters is not None: + _content = json.dumps(bare_metal_machine_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_bare_metal_machines_power_off_request( + _request = build_bare_metal_machines_update_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -1625,7 +1848,7 @@ async def _power_off_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1638,8 +1861,11 @@ async def _power_off_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + 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")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -1649,134 +1875,165 @@ async def _power_off_initial( return deserialized # type: ignore @overload - async def begin_power_off( + async def begin_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[_models.BareMetalMachinePowerOffParameters] = None, + bare_metal_machine_update_parameters: Optional[_models.BareMetalMachinePatchParameters] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Power off the provided bare metal machine. + ) -> AsyncLROPoller[_models.BareMetalMachine]: + """Patch properties of the provided bare metal machine, or update tags associated with the bare + metal machine. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_power_off_parameters: The request body. Default value is None. - :type bare_metal_machine_power_off_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters + :param bare_metal_machine_update_parameters: The request body. Default value is None. + :type bare_metal_machine_update_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters :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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_power_off( + async def begin_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[JSON] = None, + bare_metal_machine_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Power off the provided bare metal machine. + ) -> AsyncLROPoller[_models.BareMetalMachine]: + """Patch properties of the provided bare metal machine, or update tags associated with the bare + metal machine. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_power_off_parameters: The request body. Default value is None. - :type bare_metal_machine_power_off_parameters: JSON + :param bare_metal_machine_update_parameters: The request body. Default value is None. + :type bare_metal_machine_update_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_power_off( + async def begin_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[IO[bytes]] = None, + bare_metal_machine_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Power off the provided bare metal machine. + ) -> AsyncLROPoller[_models.BareMetalMachine]: + """Patch properties of the provided bare metal machine, or update tags associated with the bare + metal machine. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_power_off_parameters: The request body. Default value is None. - :type bare_metal_machine_power_off_parameters: IO[bytes] + :param bare_metal_machine_update_parameters: The request body. Default value is None. + :type bare_metal_machine_update_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_power_off( + async def begin_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[ - Union[_models.BareMetalMachinePowerOffParameters, JSON, IO[bytes]] + bare_metal_machine_update_parameters: Optional[ + Union[_models.BareMetalMachinePatchParameters, JSON, IO[bytes]] ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Power off the provided bare metal machine. + ) -> AsyncLROPoller[_models.BareMetalMachine]: + """Patch properties of the provided bare metal machine, or update tags associated with the bare + metal machine. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_power_off_parameters: The request body. Is one of the following - types: BareMetalMachinePowerOffParameters, JSON, IO[bytes] Default value is None. - :type bare_metal_machine_power_off_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :param bare_metal_machine_update_parameters: The request body. Is one of the following types: + BareMetalMachinePatchParameters, JSON, IO[bytes] Default value is None. + :type bare_metal_machine_update_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :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)) - content_type = content_type if bare_metal_machine_power_off_parameters else None - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + content_type = content_type if bare_metal_machine_update_parameters else None + cls: ClsType[_models.BareMetalMachine] = 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._power_off_initial( + raw_result = await self._update_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_power_off_parameters=bare_metal_machine_power_off_parameters, + bare_metal_machine_update_parameters=bare_metal_machine_update_parameters, + etag=etag, + match_condition=match_condition, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -1787,14 +2044,10 @@ async def begin_power_off( 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.OperationStatusResult, response.json()) + deserialized = _deserialize(_models.BareMetalMachine, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -1810,18 +2063,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + return AsyncLROPoller[_models.BareMetalMachine].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.OperationStatusResult]( + return AsyncLROPoller[_models.BareMetalMachine]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _reimage_initial( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + async def _delete_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1829,6 +2088,12 @@ async def _reimage_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1836,10 +2101,12 @@ async def _reimage_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_reimage_request( + _request = build_bare_metal_machines_delete_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -1857,7 +2124,7 @@ async def _reimage_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1870,8 +2137,8 @@ async def _reimage_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -1881,16 +2148,28 @@ async def _reimage_initial( return deserialized # type: ignore @distributed_trace_async - async def begin_reimage( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + async def begin_delete( + self, + resource_group_name: str, + bare_metal_machine_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Reimage the provided bare metal machine. + """Delete the provided bare metal machine. All customer initiated requests will be rejected as the + life cycle of this resource is managed by the system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -1905,9 +2184,11 @@ async def begin_reimage( 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._reimage_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, + etag=etag, + match_condition=match_condition, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1920,7 +2201,6 @@ 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.OperationStatusResult, response.json()) if cls: @@ -1950,15 +2230,32 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _replace_initial( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[ - Union[_models.BareMetalMachineReplaceParameters, JSON, IO[bytes]] - ] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.BareMetalMachine"]: + """Get a list of bare metal machines in the provided resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of BareMetalMachine + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.BareMetalMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.BareMetalMachine]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1967,24 +2264,215 @@ async def _replace_initial( } 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)) - content_type = content_type if bare_metal_machine_replace_parameters else None - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - content_type = content_type or "application/json" if bare_metal_machine_replace_parameters else None - _content = None - if isinstance(bare_metal_machine_replace_parameters, (IOBase, bytes)): - _content = bare_metal_machine_replace_parameters + _request = build_bare_metal_machines_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + 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.BareMetalMachine], + 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, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.BareMetalMachine"]: + """Get a list of bare metal machines in the provided subscription. + + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of BareMetalMachine + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.BareMetalMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.BareMetalMachine]] = 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_bare_metal_machines_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + 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.BareMetalMachine], + 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 _cordon_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_cordon_parameters: Optional[ + Union[_models.BareMetalMachineCordonParameters, JSON, IO[bytes]] + ] = None, + **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)) + content_type = content_type if bare_metal_machine_cordon_parameters else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if bare_metal_machine_cordon_parameters else None + _content = None + if isinstance(bare_metal_machine_cordon_parameters, (IOBase, bytes)): + _content = bare_metal_machine_cordon_parameters else: - if bare_metal_machine_replace_parameters is not None: - _content = json.dumps(bare_metal_machine_replace_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if bare_metal_machine_cordon_parameters is not None: + _content = json.dumps(bare_metal_machine_cordon_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_bare_metal_machines_replace_request( + _request = build_bare_metal_machines_cordon_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, @@ -2031,25 +2519,25 @@ async def _replace_initial( return deserialized # type: ignore @overload - async def begin_replace( + async def begin_cordon( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[_models.BareMetalMachineReplaceParameters] = None, + bare_metal_machine_cordon_parameters: Optional[_models.BareMetalMachineCordonParameters] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Replace the provided bare metal machine. + """Cordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_replace_parameters: The request body. Default value is None. - :type bare_metal_machine_replace_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters + :param bare_metal_machine_cordon_parameters: The request body. Default value is None. + :type bare_metal_machine_cordon_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineCordonParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2061,24 +2549,24 @@ async def begin_replace( """ @overload - async def begin_replace( + async def begin_cordon( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[JSON] = None, + bare_metal_machine_cordon_parameters: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Replace the provided bare metal machine. + """Cordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_replace_parameters: The request body. Default value is None. - :type bare_metal_machine_replace_parameters: JSON + :param bare_metal_machine_cordon_parameters: The request body. Default value is None. + :type bare_metal_machine_cordon_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2090,24 +2578,24 @@ async def begin_replace( """ @overload - async def begin_replace( + async def begin_cordon( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[IO[bytes]] = None, + bare_metal_machine_cordon_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Replace the provided bare metal machine. + """Cordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_replace_parameters: The request body. Default value is None. - :type bare_metal_machine_replace_parameters: IO[bytes] + :param bare_metal_machine_cordon_parameters: The request body. Default value is None. + :type bare_metal_machine_cordon_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 @@ -2119,26 +2607,26 @@ async def begin_replace( """ @distributed_trace_async - async def begin_replace( + async def begin_cordon( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[ - Union[_models.BareMetalMachineReplaceParameters, JSON, IO[bytes]] + bare_metal_machine_cordon_parameters: Optional[ + Union[_models.BareMetalMachineCordonParameters, JSON, IO[bytes]] ] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Replace the provided bare metal machine. + """Cordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_replace_parameters: The request body. Is one of the following types: - BareMetalMachineReplaceParameters, JSON, IO[bytes] Default value is None. - :type bare_metal_machine_replace_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters or JSON or IO[bytes] + :param bare_metal_machine_cordon_parameters: The request body. Is one of the following types: + BareMetalMachineCordonParameters, JSON, IO[bytes] Default value is None. + :type bare_metal_machine_cordon_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineCordonParameters or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -2149,16 +2637,16 @@ async def begin_replace( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if bare_metal_machine_replace_parameters else None + content_type = content_type if bare_metal_machine_cordon_parameters else None cls: ClsType[_models.OperationStatusResult] = 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._replace_initial( + raw_result = await self._cordon_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_replace_parameters=bare_metal_machine_replace_parameters, + bare_metal_machine_cordon_parameters=bare_metal_machine_cordon_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -2202,8 +2690,14 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _restart_initial( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + async def _power_off_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[ + Union[_models.BareMetalMachinePowerOffParameters, JSON, IO[bytes]] + ] = None, + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2213,16 +2707,30 @@ async def _restart_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)) + content_type = content_type if bare_metal_machine_power_off_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_restart_request( + content_type = content_type or "application/json" if bare_metal_machine_power_off_parameters else None + _content = None + if isinstance(bare_metal_machine_power_off_parameters, (IOBase, bytes)): + _content = bare_metal_machine_power_off_parameters + else: + if bare_metal_machine_power_off_parameters is not None: + _content = json.dumps(bare_metal_machine_power_off_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_bare_metal_machines_power_off_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -2262,34 +2770,136 @@ async def _restart_initial( return deserialized # type: ignore + @overload + async def begin_power_off( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[_models.BareMetalMachinePowerOffParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Power off the provided bare metal machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_power_off_parameters: The request body. Default value is None. + :type bare_metal_machine_power_off_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters + :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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_power_off( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Power off the provided bare metal machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_power_off_parameters: The request body. Default value is None. + :type bare_metal_machine_power_off_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_power_off( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Power off the provided bare metal machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_power_off_parameters: The request body. Default value is None. + :type bare_metal_machine_power_off_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def begin_restart( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + async def begin_power_off( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[ + Union[_models.BareMetalMachinePowerOffParameters, JSON, IO[bytes]] + ] = None, + **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Restart the provided bare metal machine. + """Power off the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str + :param bare_metal_machine_power_off_parameters: The request body. Is one of the following + types: BareMetalMachinePowerOffParameters, JSON, IO[bytes] Default value is None. + :type bare_metal_machine_power_off_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ - _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)) + content_type = content_type if bare_metal_machine_power_off_parameters else None cls: ClsType[_models.OperationStatusResult] = 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._restart_initial( + raw_result = await self._power_off_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, + bare_metal_machine_power_off_parameters=bare_metal_machine_power_off_parameters, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2332,11 +2942,24 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _run_command_initial( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "bare_metal_machine_name", + "content_type", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def _reimage_initial( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: Union[_models.BareMetalMachineRunCommandParameters, JSON, IO[bytes]], + body: Optional[Union[_models.BareMetalMachineReimageParameters, JSON, IO[bytes]]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2351,16 +2974,20 @@ async def _run_command_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None - if isinstance(bare_metal_machine_run_command_parameters, (IOBase, bytes)): - _content = bare_metal_machine_run_command_parameters + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(bare_metal_machine_run_command_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_bare_metal_machines_run_command_request( + _request = build_bare_metal_machines_reimage_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, @@ -2407,27 +3034,24 @@ async def _run_command_initial( return deserialized # type: ignore @overload - async def begin_run_command( + async def begin_reimage( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: _models.BareMetalMachineRunCommandParameters, + body: Optional[_models.BareMetalMachineReimageParameters] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run the command or the script on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Reimage the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_command_parameters: The request body. Required. - :type bare_metal_machine_run_command_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.networkcloud.models.BareMetalMachineReimageParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2439,26 +3063,24 @@ async def begin_run_command( """ @overload - async def begin_run_command( + async def begin_reimage( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: JSON, + body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run the command or the script on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Reimage the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_command_parameters: The request body. Required. - :type bare_metal_machine_run_command_parameters: JSON + :param body: The content of the action request. Default value is None. + :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 @@ -2470,26 +3092,24 @@ async def begin_run_command( """ @overload - async def begin_run_command( + async def begin_reimage( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: IO[bytes], + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run the command or the script on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Reimage the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_command_parameters: The request body. Required. - :type bare_metal_machine_run_command_parameters: IO[bytes] + :param body: The content of the action request. Default value is None. + :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 @@ -2501,26 +3121,37 @@ async def begin_run_command( """ @distributed_trace_async - async def begin_run_command( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "bare_metal_machine_name", + "content_type", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def begin_reimage( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: Union[_models.BareMetalMachineRunCommandParameters, JSON, IO[bytes]], + body: Optional[Union[_models.BareMetalMachineReimageParameters, JSON, IO[bytes]]] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run the command or the script on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Reimage the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_command_parameters: The request body. Is one of the following - types: BareMetalMachineRunCommandParameters, JSON, IO[bytes] Required. - :type bare_metal_machine_run_command_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters or JSON or IO[bytes] + :param body: The content of the action request. Is one of the following types: + BareMetalMachineReimageParameters, JSON, IO[bytes] Default value is None. + :type body: ~azure.mgmt.networkcloud.models.BareMetalMachineReimageParameters or JSON or + IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -2531,15 +3162,16 @@ async def begin_run_command( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = 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._run_command_initial( + raw_result = await self._reimage_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_run_command_parameters=bare_metal_machine_run_command_parameters, + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -2583,13 +3215,13 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _run_data_extracts_initial( + async def _replace_initial( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: Union[ - _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] - ], + bare_metal_machine_replace_parameters: Optional[ + Union[_models.BareMetalMachineReplaceParameters, JSON, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2604,16 +3236,20 @@ async def _run_data_extracts_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if bare_metal_machine_replace_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if bare_metal_machine_replace_parameters else None _content = None - if isinstance(bare_metal_machine_run_data_extracts_parameters, (IOBase, bytes)): - _content = bare_metal_machine_run_data_extracts_parameters + if isinstance(bare_metal_machine_replace_parameters, (IOBase, bytes)): + _content = bare_metal_machine_replace_parameters else: - _content = json.dumps(bare_metal_machine_run_data_extracts_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if bare_metal_machine_replace_parameters is not None: + _content = json.dumps(bare_metal_machine_replace_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_bare_metal_machines_run_data_extracts_request( + _request = build_bare_metal_machines_replace_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, @@ -2660,27 +3296,25 @@ async def _run_data_extracts_initial( return deserialized # type: ignore @overload - async def begin_run_data_extracts( + async def begin_replace( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: _models.BareMetalMachineRunDataExtractsParameters, + bare_metal_machine_replace_parameters: Optional[_models.BareMetalMachineReplaceParameters] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more data extractions on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Replace the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters + :param bare_metal_machine_replace_parameters: The request body. Default value is None. + :type bare_metal_machine_replace_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2692,26 +3326,24 @@ async def begin_run_data_extracts( """ @overload - async def begin_run_data_extracts( + async def begin_replace( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: JSON, + bare_metal_machine_replace_parameters: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more data extractions on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Replace the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_parameters: JSON + :param bare_metal_machine_replace_parameters: The request body. Default value is None. + :type bare_metal_machine_replace_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2723,26 +3355,24 @@ async def begin_run_data_extracts( """ @overload - async def begin_run_data_extracts( + async def begin_replace( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: IO[bytes], + bare_metal_machine_replace_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more data extractions on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Replace the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_parameters: IO[bytes] + :param bare_metal_machine_replace_parameters: The request body. Default value is None. + :type bare_metal_machine_replace_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 @@ -2754,28 +3384,26 @@ async def begin_run_data_extracts( """ @distributed_trace_async - async def begin_run_data_extracts( + async def begin_replace( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: Union[ - _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] - ], + bare_metal_machine_replace_parameters: Optional[ + Union[_models.BareMetalMachineReplaceParameters, JSON, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more data extractions on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Replace the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_parameters: The request body. Is one of the - following types: BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] Required. - :type bare_metal_machine_run_data_extracts_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters or JSON or IO[bytes] + :param bare_metal_machine_replace_parameters: The request body. Is one of the following types: + BareMetalMachineReplaceParameters, JSON, IO[bytes] Default value is None. + :type bare_metal_machine_replace_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -2786,15 +3414,16 @@ async def begin_run_data_extracts( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if bare_metal_machine_replace_parameters else None cls: ClsType[_models.OperationStatusResult] = 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._run_data_extracts_initial( + raw_result = await self._replace_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_run_data_extracts_parameters=bare_metal_machine_run_data_extracts_parameters, + bare_metal_machine_replace_parameters=bare_metal_machine_replace_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -2838,14 +3467,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _run_data_extracts_restricted_initial( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: Union[ - _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] - ], - **kwargs: Any + async def _restart_initial( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2855,26 +3478,16 @@ async def _run_data_extracts_restricted_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(bare_metal_machine_run_data_extracts_restricted_parameters, (IOBase, bytes)): - _content = bare_metal_machine_run_data_extracts_restricted_parameters - else: - _content = json.dumps(bare_metal_machine_run_data_extracts_restricted_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_bare_metal_machines_run_data_extracts_restricted_request( + _request = build_bare_metal_machines_restart_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -2914,143 +3527,34 @@ async def _run_data_extracts_restricted_initial( return deserialized # type: ignore - @overload - async def begin_run_data_extracts_restricted( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: _models.BareMetalMachineRunDataExtractsParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more restricted data extractions on the provided bare metal machine. The URL to - storage account with the command execution results and the command exit code can be retrieved - from the operation status API once available. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_restricted_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters - :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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_run_data_extracts_restricted( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more restricted data extractions on the provided bare metal machine. The URL to - storage account with the command execution results and the command exit code can be retrieved - from the operation status API once available. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_restricted_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_run_data_extracts_restricted( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more restricted data extractions on the provided bare metal machine. The URL to - storage account with the command execution results and the command exit code can be retrieved - from the operation status API once available. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_restricted_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_run_data_extracts_restricted( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: Union[ - _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] - ], - **kwargs: Any + async def begin_restart( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more restricted data extractions on the provided bare metal machine. The URL to - storage account with the command execution results and the command exit code can be retrieved - from the operation status API once available. + """Restart the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Is one of - the following types: BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] Required. - :type bare_metal_machine_run_data_extracts_restricted_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :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.OperationStatusResult] = 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._run_data_extracts_restricted_initial( + raw_result = await self._restart_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_run_data_extracts_restricted_parameters=bare_metal_machine_run_data_extracts_restricted_parameters, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3093,13 +3597,11 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _run_read_commands_initial( + async def _run_command_initial( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: Union[ - _models.BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] - ], + bare_metal_machine_run_command_parameters: Union[_models.BareMetalMachineRunCommandParameters, JSON, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3118,12 +3620,12 @@ async def _run_read_commands_initial( content_type = content_type or "application/json" _content = None - if isinstance(bare_metal_machine_run_read_commands_parameters, (IOBase, bytes)): - _content = bare_metal_machine_run_read_commands_parameters + if isinstance(bare_metal_machine_run_command_parameters, (IOBase, bytes)): + _content = bare_metal_machine_run_command_parameters else: - _content = json.dumps(bare_metal_machine_run_read_commands_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(bare_metal_machine_run_command_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_bare_metal_machines_run_read_commands_request( + _request = build_bare_metal_machines_run_command_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, @@ -3170,17 +3672,17 @@ async def _run_read_commands_initial( return deserialized # type: ignore @overload - async def begin_run_read_commands( + async def begin_run_command( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: _models.BareMetalMachineRunReadCommandsParameters, + bare_metal_machine_run_command_parameters: _models.BareMetalMachineRunCommandParameters, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more read-only commands on the provided bare metal machine. The URL to storage - account with the command execution results and the command exit code can be retrieved from the + """Run the command or the script on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3188,9 +3690,9 @@ async def begin_run_read_commands( :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_read_commands_parameters: The request body. Required. - :type bare_metal_machine_run_read_commands_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunReadCommandsParameters + :param bare_metal_machine_run_command_parameters: The request body. Required. + :type bare_metal_machine_run_command_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3202,17 +3704,17 @@ async def begin_run_read_commands( """ @overload - async def begin_run_read_commands( + async def begin_run_command( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: JSON, + bare_metal_machine_run_command_parameters: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more read-only commands on the provided bare metal machine. The URL to storage - account with the command execution results and the command exit code can be retrieved from the + """Run the command or the script on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3220,8 +3722,8 @@ async def begin_run_read_commands( :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_read_commands_parameters: The request body. Required. - :type bare_metal_machine_run_read_commands_parameters: JSON + :param bare_metal_machine_run_command_parameters: The request body. Required. + :type bare_metal_machine_run_command_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3233,17 +3735,17 @@ async def begin_run_read_commands( """ @overload - async def begin_run_read_commands( + async def begin_run_command( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: IO[bytes], + bare_metal_machine_run_command_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more read-only commands on the provided bare metal machine. The URL to storage - account with the command execution results and the command exit code can be retrieved from the + """Run the command or the script on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3251,8 +3753,8 @@ async def begin_run_read_commands( :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_read_commands_parameters: The request body. Required. - :type bare_metal_machine_run_read_commands_parameters: IO[bytes] + :param bare_metal_machine_run_command_parameters: The request body. Required. + :type bare_metal_machine_run_command_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 @@ -3264,17 +3766,15 @@ async def begin_run_read_commands( """ @distributed_trace_async - async def begin_run_read_commands( + async def begin_run_command( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: Union[ - _models.BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] - ], + bare_metal_machine_run_command_parameters: Union[_models.BareMetalMachineRunCommandParameters, JSON, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Run one or more read-only commands on the provided bare metal machine. The URL to storage - account with the command execution results and the command exit code can be retrieved from the + """Run the command or the script on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3282,10 +3782,10 @@ async def begin_run_read_commands( :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_read_commands_parameters: The request body. Is one of the - following types: BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] Required. - :type bare_metal_machine_run_read_commands_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunReadCommandsParameters or JSON or IO[bytes] + :param bare_metal_machine_run_command_parameters: The request body. Is one of the following + types: BareMetalMachineRunCommandParameters, JSON, IO[bytes] Required. + :type bare_metal_machine_run_command_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -3301,10 +3801,10 @@ async def begin_run_read_commands( 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._run_read_commands_initial( + raw_result = await self._run_command_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_run_read_commands_parameters=bare_metal_machine_run_read_commands_parameters, + bare_metal_machine_run_command_parameters=bare_metal_machine_run_command_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -3348,8 +3848,14 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _start_initial( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + async def _run_data_extracts_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: Union[ + _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] + ], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3359,16 +3865,26 @@ async def _start_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_bare_metal_machines_start_request( + content_type = content_type or "application/json" + _content = None + if isinstance(bare_metal_machine_run_data_extracts_parameters, (IOBase, bytes)): + _content = bare_metal_machine_run_data_extracts_parameters + else: + _content = json.dumps(bare_metal_machine_run_data_extracts_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_bare_metal_machines_run_data_extracts_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -3408,34 +3924,143 @@ async def _start_initial( return deserialized # type: ignore + @overload + async def begin_run_data_extracts( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: _models.BareMetalMachineRunDataExtractsParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more data extractions on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the + operation status API once available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters + :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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_data_extracts( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more data extractions on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the + operation status API once available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_data_extracts( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more data extractions on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the + operation status API once available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def begin_start( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + async def begin_run_data_extracts( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: Union[ + _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] + ], + **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Start the provided bare metal machine. + """Run one or more data extractions on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_parameters: The request body. Is one of the + following types: BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] Required. + :type bare_metal_machine_run_data_extracts_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ - _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[_models.OperationStatusResult] = 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._start_initial( + raw_result = await self._run_data_extracts_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, + bare_metal_machine_run_data_extracts_parameters=bare_metal_machine_run_data_extracts_parameters, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3478,8 +4103,14 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _uncordon_initial( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + async def _run_data_extracts_restricted_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: Union[ + _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] + ], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3489,16 +4120,26 @@ async def _uncordon_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_bare_metal_machines_uncordon_request( + content_type = content_type or "application/json" + _content = None + if isinstance(bare_metal_machine_run_data_extracts_restricted_parameters, (IOBase, bytes)): + _content = bare_metal_machine_run_data_extracts_restricted_parameters + else: + _content = json.dumps(bare_metal_machine_run_data_extracts_restricted_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_bare_metal_machines_run_data_extracts_restricted_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -3538,174 +4179,192 @@ async def _uncordon_initial( return deserialized # type: ignore - @distributed_trace_async - async def begin_uncordon( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + @overload + async def begin_run_data_extracts_restricted( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: _models.BareMetalMachineRunDataExtractsParameters, + *, + content_type: str = "application/json", + **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Uncordon the provided bare metal machine's Kubernetes node. + """Run one or more restricted data extractions on the provided bare metal machine. The URL to + storage account with the command execution results and the command exit code can be retrieved + from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_restricted_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters + :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 OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OperationStatusResult] = 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._uncordon_initial( - resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_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["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + @overload + async def begin_run_data_extracts_restricted( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more restricted data extractions on the provided bare metal machine. The URL to + storage account with the command execution results and the command exit code can be retrieved + from the operation status API once available. - deserialized = _deserialize(_models.OperationStatusResult, 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 bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_restricted_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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_run_data_extracts_restricted( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more restricted data extractions on the provided bare metal machine. The URL to + storage account with the command execution results and the command exit code can be retrieved + from the operation status API once available. - 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.OperationStatusResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OperationStatusResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class CloudServicesNetworksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.networkcloud.aio.NetworkCloudMgmtClient`'s - :attr:`cloud_services_networks` 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: NetworkCloudMgmtClientConfiguration = 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 bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_restricted_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get( - self, resource_group_name: str, cloud_services_network_name: str, **kwargs: Any - ) -> _models.CloudServicesNetwork: - """Get properties of the provided cloud services network. + async def begin_run_data_extracts_restricted( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: Union[ + _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more restricted data extractions on the provided bare metal machine. The URL to + storage account with the command execution results and the command exit code can be retrieved + from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :return: CloudServicesNetwork. The CloudServicesNetwork is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.CloudServicesNetwork + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Is one of + the following types: BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] Required. + :type bare_metal_machine_run_data_extracts_restricted_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :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.CloudServicesNetwork] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OperationStatusResult] = 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._run_data_extracts_restricted_initial( + resource_group_name=resource_group_name, + bare_metal_machine_name=bare_metal_machine_name, + bare_metal_machine_run_data_extracts_restricted_parameters=bare_metal_machine_run_data_extracts_restricted_parameters, + 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.OperationStatusResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized - _request = build_cloud_services_networks_get_request( - resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_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.CloudServicesNetwork, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _create_or_update_initial( + async def _run_read_commands_initial( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: Union[_models.CloudServicesNetwork, JSON, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: Union[ + _models.BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3714,12 +4373,6 @@ async def _create_or_update_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3730,17 +4383,15 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(cloud_services_network_parameters, (IOBase, bytes)): - _content = cloud_services_network_parameters + if isinstance(bare_metal_machine_run_read_commands_parameters, (IOBase, bytes)): + _content = bare_metal_machine_run_read_commands_parameters else: - _content = json.dumps(cloud_services_network_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(bare_metal_machine_run_read_commands_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_cloud_services_networks_create_or_update_request( + _request = build_bare_metal_machines_run_read_commands_request( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, + bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -3760,7 +4411,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 [202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -3773,10 +4424,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") - ) + 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() @@ -3786,165 +4435,141 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_run_read_commands( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: _models.CloudServicesNetwork, + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: _models.BareMetalMachineRunReadCommandsParameters, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.CloudServicesNetwork]: - """Create a new cloud services network or update the properties of the existing cloud services - network. + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more read-only commands on the provided bare metal machine. The URL to storage + account with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_parameters: The request body. Required. - :type cloud_services_network_parameters: ~azure.mgmt.networkcloud.models.CloudServicesNetwork + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_read_commands_parameters: The request body. Required. + :type bare_metal_machine_run_read_commands_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunReadCommandsParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The - CloudServicesNetwork is compatible with MutableMapping + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_run_read_commands( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: JSON, + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: JSON, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.CloudServicesNetwork]: - """Create a new cloud services network or update the properties of the existing cloud services - network. + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more read-only commands on the provided bare metal machine. The URL to storage + account with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_parameters: The request body. Required. - :type cloud_services_network_parameters: JSON + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_read_commands_parameters: The request body. Required. + :type bare_metal_machine_run_read_commands_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The - CloudServicesNetwork is compatible with MutableMapping + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_run_read_commands( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: IO[bytes], + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.CloudServicesNetwork]: - """Create a new cloud services network or update the properties of the existing cloud services - network. + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more read-only commands on the provided bare metal machine. The URL to storage + account with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_parameters: The request body. Required. - :type cloud_services_network_parameters: IO[bytes] + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_read_commands_parameters: The request body. Required. + :type bare_metal_machine_run_read_commands_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 - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The - CloudServicesNetwork is compatible with MutableMapping + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_or_update( + async def begin_run_read_commands( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: Union[_models.CloudServicesNetwork, JSON, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: Union[ + _models.BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] + ], **kwargs: Any - ) -> AsyncLROPoller[_models.CloudServicesNetwork]: - """Create a new cloud services network or update the properties of the existing cloud services - network. + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Run one or more read-only commands on the provided bare metal machine. The URL to storage + account with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_parameters: The request body. Is one of the following types: - CloudServicesNetwork, JSON, IO[bytes] Required. - :type cloud_services_network_parameters: ~azure.mgmt.networkcloud.models.CloudServicesNetwork - or JSON or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The - CloudServicesNetwork is compatible with MutableMapping + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_read_commands_parameters: The request body. Is one of the + following types: BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] Required. + :type bare_metal_machine_run_read_commands_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunReadCommandsParameters or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :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.CloudServicesNetwork] = kwargs.pop("cls", None) + cls: ClsType[_models.OperationStatusResult] = 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._run_read_commands_initial( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, - cloud_services_network_parameters=cloud_services_network_parameters, - etag=etag, - match_condition=match_condition, + bare_metal_machine_name=bare_metal_machine_name, + bare_metal_machine_run_read_commands_parameters=bare_metal_machine_run_read_commands_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -3955,10 +4580,14 @@ async 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.CloudServicesNetwork, response.json()) + 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.OperationStatusResult, 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 = { @@ -3974,27 +4603,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.CloudServicesNetwork].from_continuation_token( + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.CloudServicesNetwork]( + return AsyncLROPoller[_models.OperationStatusResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _update_initial( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[ - Union[_models.CloudServicesNetworkPatchParameters, JSON, IO[bytes]] - ] = None, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + async def _start_initial( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4002,40 +4622,18 @@ async def _update_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError 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)) - content_type = content_type if cloud_services_network_update_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if cloud_services_network_update_parameters else None - _content = None - if isinstance(cloud_services_network_update_parameters, (IOBase, bytes)): - _content = cloud_services_network_update_parameters - else: - if cloud_services_network_update_parameters is not None: - _content = json.dumps(cloud_services_network_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_cloud_services_networks_update_request( + _request = build_bare_metal_machines_start_request( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, + bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -4052,7 +4650,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4065,11 +4663,8 @@ async def _update_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["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() @@ -4078,184 +4673,51 @@ async def _update_initial( return deserialized # type: ignore - @overload - async def begin_update( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[_models.CloudServicesNetworkPatchParameters] = None, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudServicesNetwork]: - """Update properties of the provided cloud services network, or update the tags associated with - it. Properties and tag updates can be done independently. + @distributed_trace_async + async def begin_start( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Start the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_update_parameters: The request body. Default value is None. - :type cloud_services_network_update_parameters: - ~azure.mgmt.networkcloud.models.CloudServicesNetworkPatchParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The - CloudServicesNetwork is compatible with MutableMapping + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def begin_update( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[JSON] = None, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudServicesNetwork]: - """Update properties of the provided cloud services network, or update the tags associated with - it. Properties and tag updates can be done independently. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_update_parameters: The request body. Default value is None. - :type cloud_services_network_update_parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The - CloudServicesNetwork is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudServicesNetwork]: - """Update properties of the provided cloud services network, or update the tags associated with - it. Properties and tag updates can be done independently. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_update_parameters: The request body. Default value is None. - :type cloud_services_network_update_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 - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The - CloudServicesNetwork is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[ - Union[_models.CloudServicesNetworkPatchParameters, JSON, IO[bytes]] - ] = None, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudServicesNetwork]: - """Update properties of the provided cloud services network, or update the tags associated with - it. Properties and tag updates can be done independently. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_update_parameters: The request body. Is one of the following - types: CloudServicesNetworkPatchParameters, JSON, IO[bytes] Default value is None. - :type cloud_services_network_update_parameters: - ~azure.mgmt.networkcloud.models.CloudServicesNetworkPatchParameters or JSON or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The - CloudServicesNetwork is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] - :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)) - content_type = content_type if cloud_services_network_update_parameters else None - cls: ClsType[_models.CloudServicesNetwork] = 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, - cloud_services_network_name=cloud_services_network_name, - cloud_services_network_update_parameters=cloud_services_network_update_parameters, - etag=etag, - match_condition=match_condition, - 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.OperationStatusResult] = 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._start_initial( + resource_group_name=resource_group_name, + bare_metal_machine_name=bare_metal_machine_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 - deserialized = _deserialize(_models.CloudServicesNetwork, response.json()) + 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.OperationStatusResult, 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 = { @@ -4271,24 +4733,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.CloudServicesNetwork].from_continuation_token( + return AsyncLROPoller[_models.OperationStatusResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.CloudServicesNetwork]( + return AsyncLROPoller[_models.OperationStatusResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( - self, - resource_group_name: str, - cloud_services_network_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + async def _uncordon_initial( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4296,12 +4752,6 @@ async def _delete_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -4309,12 +4759,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_cloud_services_networks_delete_request( + _request = build_bare_metal_machines_uncordon_request( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, + bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4332,7 +4780,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4345,8 +4793,8 @@ 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["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() @@ -4356,27 +4804,16 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - cloud_services_network_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + async def begin_uncordon( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Delete the provided cloud services network. + """Uncordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -4391,11 +4828,9 @@ async def begin_delete( 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._uncordon_initial( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, - etag=etag, - match_condition=match_condition, + bare_metal_machine_name=bare_metal_machine_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -4408,6 +4843,7 @@ 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.OperationStatusResult, response.json()) if cls: @@ -4437,32 +4873,39 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.CloudServicesNetwork"]: - """Get a list of cloud services networks in the provided resource group. + +class CloudServicesNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.networkcloud.aio.NetworkCloudMgmtClient`'s + :attr:`cloud_services_networks` 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: NetworkCloudMgmtClientConfiguration = 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, cloud_services_network_name: str, **kwargs: Any + ) -> _models.CloudServicesNetwork: + """Get properties of the provided cloud services network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. - Default value is None. - :paramtype top: int - :keyword skip_token: The opaque token that the server returns to indicate where to continue - listing resources from. This is used for paging through large result sets. Default value is - None. - :paramtype skip_token: str - :return: An iterator like instance of CloudServicesNetwork - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :return: CloudServicesNetwork. The CloudServicesNetwork is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.CloudServicesNetwork :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CloudServicesNetwork]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4471,227 +4914,14 @@ def list_by_resource_group( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_cloud_services_networks_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - top=top, - skip_token=skip_token, - 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[_models.CloudServicesNetwork] = kwargs.pop("cls", None) - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CloudServicesNetwork], - 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, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.CloudServicesNetwork"]: - """Get a list of cloud services networks in the provided subscription. - - :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. - Default value is None. - :paramtype top: int - :keyword skip_token: The opaque token that the server returns to indicate where to continue - listing resources from. This is used for paging through large result sets. Default value is - None. - :paramtype skip_token: str - :return: An iterator like instance of CloudServicesNetwork - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.CloudServicesNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CloudServicesNetwork]] = 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_cloud_services_networks_list_by_subscription_request( - subscription_id=self._config.subscription_id, - top=top, - skip_token=skip_token, - 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.CloudServicesNetwork], - 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 ClusterManagersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.networkcloud.aio.NetworkCloudMgmtClient`'s - :attr:`cluster_managers` 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: NetworkCloudMgmtClientConfiguration = 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_manager_name: str, **kwargs: Any) -> _models.ClusterManager: - """Get the properties of the provided cluster manager. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager - :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.ClusterManager] = kwargs.pop("cls", None) - - _request = build_cluster_managers_get_request( + _request = build_cloud_services_networks_get_request( resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, + cloud_services_network_name=cloud_services_network_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4726,7 +4956,7 @@ async def get(self, resource_group_name: str, cluster_manager_name: str, **kwarg if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ClusterManager, response.json()) + deserialized = _deserialize(_models.CloudServicesNetwork, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4736,8 +4966,8 @@ async def get(self, resource_group_name: str, cluster_manager_name: str, **kwarg async def _create_or_update_initial( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: Union[_models.ClusterManager, JSON, IO[bytes]], + cloud_services_network_name: str, + cloud_services_network_parameters: Union[_models.CloudServicesNetwork, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -4765,14 +4995,14 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(cluster_manager_parameters, (IOBase, bytes)): - _content = cluster_manager_parameters + if isinstance(cloud_services_network_parameters, (IOBase, bytes)): + _content = cloud_services_network_parameters else: - _content = json.dumps(cluster_manager_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(cloud_services_network_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_cluster_managers_create_or_update_request( + _request = build_cloud_services_networks_create_or_update_request( resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, + cloud_services_network_name=cloud_services_network_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -4824,23 +5054,24 @@ async def _create_or_update_initial( async def begin_create_or_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: _models.ClusterManager, + cloud_services_network_name: str, + cloud_services_network_parameters: _models.CloudServicesNetwork, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterManager]: - """Create a new cluster manager or update properties of the cluster manager if it exists. + ) -> AsyncLROPoller[_models.CloudServicesNetwork]: + """Create a new cloud services network or update the properties of the existing cloud services + network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_parameters: The request body. Required. - :type cluster_manager_parameters: ~azure.mgmt.networkcloud.models.ClusterManager + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_parameters: The request body. Required. + :type cloud_services_network_parameters: ~azure.mgmt.networkcloud.models.CloudServicesNetwork :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4849,9 +5080,10 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns ClusterManager. The ClusterManager is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The + CloudServicesNetwork is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4859,23 +5091,24 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: JSON, + cloud_services_network_name: str, + cloud_services_network_parameters: JSON, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterManager]: - """Create a new cluster manager or update properties of the cluster manager if it exists. + ) -> AsyncLROPoller[_models.CloudServicesNetwork]: + """Create a new cloud services network or update the properties of the existing cloud services + network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_parameters: The request body. Required. - :type cluster_manager_parameters: JSON + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_parameters: The request body. Required. + :type cloud_services_network_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4884,9 +5117,10 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns ClusterManager. The ClusterManager is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The + CloudServicesNetwork is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4894,23 +5128,24 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: IO[bytes], + cloud_services_network_name: str, + cloud_services_network_parameters: IO[bytes], *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterManager]: - """Create a new cluster manager or update properties of the cluster manager if it exists. + ) -> AsyncLROPoller[_models.CloudServicesNetwork]: + """Create a new cloud services network or update the properties of the existing cloud services + network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_parameters: The request body. Required. - :type cluster_manager_parameters: IO[bytes] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_parameters: The request body. Required. + :type cloud_services_network_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 @@ -4919,9 +5154,10 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns ClusterManager. The ClusterManager is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The + CloudServicesNetwork is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4929,47 +5165,49 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: Union[_models.ClusterManager, JSON, IO[bytes]], + cloud_services_network_name: str, + cloud_services_network_parameters: Union[_models.CloudServicesNetwork, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterManager]: - """Create a new cluster manager or update properties of the cluster manager if it exists. + ) -> AsyncLROPoller[_models.CloudServicesNetwork]: + """Create a new cloud services network or update the properties of the existing cloud services + network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_parameters: The request body. Is one of the following types: - ClusterManager, JSON, IO[bytes] Required. - :type cluster_manager_parameters: ~azure.mgmt.networkcloud.models.ClusterManager or JSON or - IO[bytes] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_parameters: The request body. Is one of the following types: + CloudServicesNetwork, JSON, IO[bytes] Required. + :type cloud_services_network_parameters: ~azure.mgmt.networkcloud.models.CloudServicesNetwork + or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns ClusterManager. The ClusterManager is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The + CloudServicesNetwork is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :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.ClusterManager] = kwargs.pop("cls", None) + cls: ClsType[_models.CloudServicesNetwork] = 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_manager_name=cluster_manager_name, - cluster_manager_parameters=cluster_manager_parameters, + cloud_services_network_name=cloud_services_network_name, + cloud_services_network_parameters=cloud_services_network_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -4983,7 +5221,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ClusterManager, response.json()) + deserialized = _deserialize(_models.CloudServicesNetwork, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -5001,39 +5239,133 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.ClusterManager].from_continuation_token( + return AsyncLROPoller[_models.CloudServicesNetwork].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ClusterManager]( + return AsyncLROPoller[_models.CloudServicesNetwork]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + async def _update_initial( + self, + resource_group_name: str, + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[ + Union[_models.CloudServicesNetworkPatchParameters, JSON, IO[bytes]] + ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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)) + content_type = content_type if cloud_services_network_update_parameters else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if cloud_services_network_update_parameters else None + _content = None + if isinstance(cloud_services_network_update_parameters, (IOBase, bytes)): + _content = cloud_services_network_update_parameters + else: + if cloud_services_network_update_parameters is not None: + _content = json.dumps(cloud_services_network_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_cloud_services_networks_update_request( + resource_group_name=resource_group_name, + cloud_services_network_name=cloud_services_network_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + 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 update( + async def begin_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_update_parameters: Optional[_models.ClusterManagerPatchParameters] = None, + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[_models.CloudServicesNetworkPatchParameters] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.ClusterManager: - """Patch properties of the provided cluster manager, or update the tags assigned to the cluster - manager. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.CloudServicesNetwork]: + """Update properties of the provided cloud services network, or update the tags associated with + it. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_update_parameters: The request body. Default value is None. - :type cluster_manager_update_parameters: - ~azure.mgmt.networkcloud.models.ClusterManagerPatchParameters + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_update_parameters: The request body. Default value is None. + :type cloud_services_network_update_parameters: + ~azure.mgmt.networkcloud.models.CloudServicesNetworkPatchParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5042,33 +5374,35 @@ async def update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager + :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The + CloudServicesNetwork is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update( + async def begin_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_update_parameters: Optional[JSON] = None, + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.ClusterManager: - """Patch properties of the provided cluster manager, or update the tags assigned to the cluster - manager. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.CloudServicesNetwork]: + """Update properties of the provided cloud services network, or update the tags associated with + it. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_update_parameters: The request body. Default value is None. - :type cluster_manager_update_parameters: JSON + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_update_parameters: The request body. Default value is None. + :type cloud_services_network_update_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5077,33 +5411,35 @@ async def update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager + :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The + CloudServicesNetwork is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update( + async def begin_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_update_parameters: Optional[IO[bytes]] = None, + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.ClusterManager: - """Patch properties of the provided cluster manager, or update the tags assigned to the cluster - manager. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.CloudServicesNetwork]: + """Update properties of the provided cloud services network, or update the tags associated with + it. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_update_parameters: The request body. Default value is None. - :type cluster_manager_update_parameters: IO[bytes] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_update_parameters: The request body. Default value is None. + :type cloud_services_network_update_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 @@ -5112,128 +5448,108 @@ async def update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager + :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The + CloudServicesNetwork is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def update( + async def begin_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_update_parameters: Optional[ - Union[_models.ClusterManagerPatchParameters, JSON, IO[bytes]] + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[ + Union[_models.CloudServicesNetworkPatchParameters, JSON, IO[bytes]] ] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.ClusterManager: - """Patch properties of the provided cluster manager, or update the tags assigned to the cluster - manager. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.CloudServicesNetwork]: + """Update properties of the provided cloud services network, or update the tags associated with + it. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_update_parameters: The request body. Is one of the following types: - ClusterManagerPatchParameters, JSON, IO[bytes] Default value is None. - :type cluster_manager_update_parameters: - ~azure.mgmt.networkcloud.models.ClusterManagerPatchParameters or JSON or IO[bytes] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_update_parameters: The request body. Is one of the following + types: CloudServicesNetworkPatchParameters, JSON, IO[bytes] Default value is None. + :type cloud_services_network_update_parameters: + ~azure.mgmt.networkcloud.models.CloudServicesNetworkPatchParameters or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager + :return: An instance of AsyncLROPoller that returns CloudServicesNetwork. The + CloudServicesNetwork is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError - 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)) - content_type = content_type if cluster_manager_update_parameters else None - cls: ClsType[_models.ClusterManager] = kwargs.pop("cls", None) + content_type = content_type if cloud_services_network_update_parameters else None + cls: ClsType[_models.CloudServicesNetwork] = 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, + cloud_services_network_name=cloud_services_network_name, + cloud_services_network_update_parameters=cloud_services_network_update_parameters, + etag=etag, + match_condition=match_condition, + 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" if cluster_manager_update_parameters else None - _content = None - if isinstance(cluster_manager_update_parameters, (IOBase, bytes)): - _content = cluster_manager_update_parameters - else: - if cluster_manager_update_parameters is not None: - _content = json.dumps(cluster_manager_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudServicesNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_cluster_managers_update_request( - resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, - subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - 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.ClusterManager, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudServicesNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudServicesNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) async def _delete_initial( self, resource_group_name: str, - cluster_manager_name: str, + cloud_services_network_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -5258,9 +5574,9 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_cluster_managers_delete_request( + _request = build_cloud_services_networks_delete_request( resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, + cloud_services_network_name=cloud_services_network_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -5308,19 +5624,19 @@ async def _delete_initial( async def begin_delete( self, resource_group_name: str, - cluster_manager_name: str, + cloud_services_network_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Delete the provided cluster manager. + """Delete the provided cloud services network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -5342,7 +5658,7 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, + cloud_services_network_name=cloud_services_network_name, etag=etag, match_condition=match_condition, cls=lambda x, y, z: x, @@ -5389,8 +5705,8 @@ def get_long_running_output(pipeline_response): @distributed_trace def list_by_resource_group( self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ClusterManager"]: - """Get a list of cluster managers in the provided resource group. + ) -> AsyncItemPaged["_models.CloudServicesNetwork"]: + """Get a list of cloud services networks in the provided resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5402,14 +5718,15 @@ def list_by_resource_group( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of ClusterManager - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An iterator like instance of CloudServicesNetwork + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ClusterManager]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CloudServicesNetwork]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5422,7 +5739,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_cluster_managers_list_by_resource_group_request( + _request = build_cloud_services_networks_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, top=top, @@ -5463,7 +5780,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.ClusterManager], + List[_models.CloudServicesNetwork], deserialized.get("value", []), ) if cls: @@ -5494,8 +5811,8 @@ async def get_next(next_link=None): @distributed_trace def list_by_subscription( self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ClusterManager"]: - """Get a list of cluster managers in the provided subscription. + ) -> AsyncItemPaged["_models.CloudServicesNetwork"]: + """Get a list of cloud services networks in the provided subscription. :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -5504,14 +5821,15 @@ def list_by_subscription( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of ClusterManager - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An iterator like instance of CloudServicesNetwork + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ClusterManager]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CloudServicesNetwork]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5524,7 +5842,7 @@ def list_by_subscription( def prepare_request(next_link=None): if not next_link: - _request = build_cluster_managers_list_by_subscription_request( + _request = build_cloud_services_networks_list_by_subscription_request( subscription_id=self._config.subscription_id, top=top, skip_token=skip_token, @@ -5564,7 +5882,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.ClusterManager], + List[_models.CloudServicesNetwork], deserialized.get("value", []), ) if cls: @@ -5593,14 +5911,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ClustersOperations: +class ClusterManagersOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.networkcloud.aio.NetworkCloudMgmtClient`'s - :attr:`clusters` attribute. + :attr:`cluster_managers` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -5611,16 +5929,16 @@ 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, **kwargs: Any) -> _models.Cluster: - """Get properties of the provided cluster. + async def get(self, resource_group_name: str, cluster_manager_name: str, **kwargs: Any) -> _models.ClusterManager: + """Get the properties of the provided cluster manager. :param resource_group_name: The name of the resource group. 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.networkcloud.models.Cluster + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5634,11 +5952,11 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + cls: ClsType[_models.ClusterManager] = kwargs.pop("cls", None) - _request = build_clusters_get_request( + _request = build_cluster_managers_get_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5673,7 +5991,7 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Cluster, response.json()) + deserialized = _deserialize(_models.ClusterManager, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5683,8 +6001,8 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: Union[_models.Cluster, JSON, IO[bytes]], + cluster_manager_name: str, + cluster_manager_parameters: Union[_models.ClusterManager, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -5712,14 +6030,14 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(cluster_parameters, (IOBase, bytes)): - _content = cluster_parameters + if isinstance(cluster_manager_parameters, (IOBase, bytes)): + _content = cluster_manager_parameters else: - _content = json.dumps(cluster_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(cluster_manager_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_clusters_create_or_update_request( + _request = build_cluster_managers_create_or_update_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -5771,23 +6089,23 @@ async def _create_or_update_initial( async def begin_create_or_update( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: _models.Cluster, + cluster_manager_name: str, + cluster_manager_parameters: _models.ClusterManager, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Create a new cluster or update the properties of the cluster if it exists. + ) -> AsyncLROPoller[_models.ClusterManager]: + """Create a new cluster manager or update properties of the cluster manager if it exists. :param resource_group_name: The name of the resource group. 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_parameters: The request body. Required. - :type cluster_parameters: ~azure.mgmt.networkcloud.models.Cluster + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_parameters: The request body. Required. + :type cluster_manager_parameters: ~azure.mgmt.networkcloud.models.ClusterManager :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5796,9 +6114,9 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: An instance of AsyncLROPoller that returns ClusterManager. The ClusterManager is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5806,23 +6124,23 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: JSON, + cluster_manager_name: str, + cluster_manager_parameters: JSON, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Create a new cluster or update the properties of the cluster if it exists. + ) -> AsyncLROPoller[_models.ClusterManager]: + """Create a new cluster manager or update properties of the cluster manager if it exists. :param resource_group_name: The name of the resource group. 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_parameters: The request body. Required. - :type cluster_parameters: JSON + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_parameters: The request body. Required. + :type cluster_manager_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5831,9 +6149,9 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: An instance of AsyncLROPoller that returns ClusterManager. The ClusterManager is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5841,23 +6159,23 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: IO[bytes], + cluster_manager_name: str, + cluster_manager_parameters: IO[bytes], *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Create a new cluster or update the properties of the cluster if it exists. + ) -> AsyncLROPoller[_models.ClusterManager]: + """Create a new cluster manager or update properties of the cluster manager if it exists. :param resource_group_name: The name of the resource group. 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_parameters: The request body. Required. - :type cluster_parameters: IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_parameters: The request body. Required. + :type cluster_manager_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 @@ -5866,9 +6184,9 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: An instance of AsyncLROPoller that returns ClusterManager. The ClusterManager is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5876,46 +6194,47 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: Union[_models.Cluster, JSON, IO[bytes]], + cluster_manager_name: str, + cluster_manager_parameters: Union[_models.ClusterManager, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Create a new cluster or update the properties of the cluster if it exists. + ) -> AsyncLROPoller[_models.ClusterManager]: + """Create a new cluster manager or update properties of the cluster manager if it exists. :param resource_group_name: The name of the resource group. 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_parameters: The request body. Is one of the following types: Cluster, JSON, - IO[bytes] Required. - :type cluster_parameters: ~azure.mgmt.networkcloud.models.Cluster or JSON or IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_parameters: The request body. Is one of the following types: + ClusterManager, JSON, IO[bytes] Required. + :type cluster_manager_parameters: ~azure.mgmt.networkcloud.models.ClusterManager or JSON or + IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: An instance of AsyncLROPoller that returns ClusterManager. The ClusterManager is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.ClusterManager] :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) + cls: ClsType[_models.ClusterManager] = 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, - cluster_parameters=cluster_parameters, + cluster_manager_name=cluster_manager_name, + cluster_manager_parameters=cluster_manager_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -5929,7 +6248,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Cluster, response.json()) + deserialized = _deserialize(_models.ClusterManager, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -5947,130 +6266,39 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( + return AsyncLROPoller[_models.ClusterManager].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Cluster]( + return AsyncLROPoller[_models.ClusterManager]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[Union[_models.ClusterPatchParameters, JSON, IO[bytes]]] = None, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError - 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)) - content_type = content_type if cluster_update_parameters else None - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if cluster_update_parameters else None - _content = None - if isinstance(cluster_update_parameters, (IOBase, bytes)): - _content = cluster_update_parameters - else: - if cluster_update_parameters is not None: - _content = json.dumps(cluster_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_clusters_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - 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["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - 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( + async def update( self, resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[_models.ClusterPatchParameters] = None, + cluster_manager_name: str, + cluster_manager_update_parameters: Optional[_models.ClusterManagerPatchParameters] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Patch the properties of the provided cluster, or update the tags associated with the cluster. - Properties and tag updates can be done independently. + ) -> _models.ClusterManager: + """Patch properties of the provided cluster manager, or update the tags assigned to the cluster + manager. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_update_parameters: The request body. Default value is None. - :type cluster_update_parameters: ~azure.mgmt.networkcloud.models.ClusterPatchParameters + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_parameters: The request body. Default value is None. + :type cluster_manager_update_parameters: + ~azure.mgmt.networkcloud.models.ClusterManagerPatchParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6079,34 +6307,33 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def update( self, resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[JSON] = None, + cluster_manager_name: str, + cluster_manager_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Patch the properties of the provided cluster, or update the tags associated with the cluster. - Properties and tag updates can be done independently. + ) -> _models.ClusterManager: + """Patch properties of the provided cluster manager, or update the tags assigned to the cluster + manager. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_update_parameters: The request body. Default value is None. - :type cluster_update_parameters: JSON + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_parameters: The request body. Default value is None. + :type cluster_manager_update_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6115,34 +6342,33 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def update( self, resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[IO[bytes]] = None, + cluster_manager_name: str, + cluster_manager_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Patch the properties of the provided cluster, or update the tags associated with the cluster. - Properties and tag updates can be done independently. + ) -> _models.ClusterManager: + """Patch properties of the provided cluster manager, or update the tags assigned to the cluster + manager. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_update_parameters: The request body. Default value is None. - :type cluster_update_parameters: IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_parameters: The request body. Default value is None. + :type cluster_manager_update_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 @@ -6151,104 +6377,128 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_update( + async def update( self, resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[Union[_models.ClusterPatchParameters, JSON, IO[bytes]]] = None, + cluster_manager_name: str, + cluster_manager_update_parameters: Optional[ + Union[_models.ClusterManagerPatchParameters, JSON, IO[bytes]] + ] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Patch the properties of the provided cluster, or update the tags associated with the cluster. - Properties and tag updates can be done independently. + ) -> _models.ClusterManager: + """Patch properties of the provided cluster manager, or update the tags assigned to the cluster + manager. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_update_parameters: The request body. Is one of the following types: - ClusterPatchParameters, JSON, IO[bytes] Default value is None. - :type cluster_update_parameters: ~azure.mgmt.networkcloud.models.ClusterPatchParameters or JSON - or IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_parameters: The request body. Is one of the following types: + ClusterManagerPatchParameters, JSON, IO[bytes] Default value is None. + :type cluster_manager_update_parameters: + ~azure.mgmt.networkcloud.models.ClusterManagerPatchParameters or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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)) - content_type = content_type if cluster_update_parameters else 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_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_update_parameters=cluster_update_parameters, - etag=etag, - match_condition=match_condition, - 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 if cluster_manager_update_parameters else None + cls: ClsType[_models.ClusterManager] = kwargs.pop("cls", 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 + content_type = content_type or "application/json" if cluster_manager_update_parameters else None + _content = None + if isinstance(cluster_manager_update_parameters, (IOBase, bytes)): + _content = cluster_manager_update_parameters + else: + if cluster_manager_update_parameters is not None: + _content = json.dumps(cluster_manager_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + _request = build_cluster_managers_update_request( + resource_group_name=resource_group_name, + cluster_manager_name=cluster_manager_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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.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 - ) + deserialized = _deserialize(_models.ClusterManager, 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, + cluster_manager_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -6273,9 +6523,9 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_clusters_delete_request( + _request = build_cluster_managers_delete_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -6323,19 +6573,19 @@ async def _delete_initial( async def begin_delete( self, resource_group_name: str, - cluster_name: str, + cluster_manager_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Delete the provided cluster. + """Delete the provided cluster manager. :param resource_group_name: The name of the resource group. 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_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -6357,7 +6607,7 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, etag=etag, match_condition=match_condition, cls=lambda x, y, z: x, @@ -6404,8 +6654,8 @@ def get_long_running_output(pipeline_response): @distributed_trace def list_by_resource_group( self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Cluster"]: - """Get a list of clusters in the provided resource group. + ) -> AsyncItemPaged["_models.ClusterManager"]: + """Get a list of cluster managers in the provided resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -6417,14 +6667,14 @@ def list_by_resource_group( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of Cluster - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.Cluster] + :return: An iterator like instance of ClusterManager + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ClusterManager]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6437,7 +6687,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_clusters_list_by_resource_group_request( + _request = build_cluster_managers_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, top=top, @@ -6478,7 +6728,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.Cluster], + List[_models.ClusterManager], deserialized.get("value", []), ) if cls: @@ -6509,8 +6759,8 @@ async def get_next(next_link=None): @distributed_trace def list_by_subscription( self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Cluster"]: - """Get a list of clusters in the provided subscription. + ) -> AsyncItemPaged["_models.ClusterManager"]: + """Get a list of cluster managers in the provided subscription. :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -6519,14 +6769,14 @@ def list_by_subscription( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of Cluster - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.Cluster] + :return: An iterator like instance of ClusterManager + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ClusterManager]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6539,7 +6789,7 @@ def list_by_subscription( def prepare_request(next_link=None): if not next_link: - _request = build_clusters_list_by_subscription_request( + _request = build_cluster_managers_list_by_subscription_request( subscription_id=self._config.subscription_id, top=top, skip_token=skip_token, @@ -6579,7 +6829,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.Cluster], + List[_models.ClusterManager], deserialized.get("value", []), ) if cls: @@ -6607,13 +6857,26 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - async def _continue_update_version_initial( + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_manager_name", + "content_type", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + async def _update_relay_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: Union[ - _models.ClusterContinueUpdateVersionParameters, JSON, IO[bytes] - ], + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[ + Union[_models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters, JSON, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -6628,18 +6891,26 @@ async def _continue_update_version_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if cluster_manager_update_relay_private_endpoint_connection_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = ( + content_type or "application/json" + if cluster_manager_update_relay_private_endpoint_connection_parameters + else None + ) _content = None - if isinstance(cluster_continue_update_version_parameters, (IOBase, bytes)): - _content = cluster_continue_update_version_parameters + if isinstance(cluster_manager_update_relay_private_endpoint_connection_parameters, (IOBase, bytes)): + _content = cluster_manager_update_relay_private_endpoint_connection_parameters else: - _content = json.dumps(cluster_continue_update_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if cluster_manager_update_relay_private_endpoint_connection_parameters is not None: + _content = json.dumps(cluster_manager_update_relay_private_endpoint_connection_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_clusters_continue_update_version_request( + _request = build_cluster_managers_update_relay_private_endpoint_connection_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6684,26 +6955,30 @@ async def _continue_update_version_initial( return deserialized # type: ignore @overload - async def begin_continue_update_version( + async def begin_update_relay_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: _models.ClusterContinueUpdateVersionParameters, + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[ + _models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters + ] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Trigger the continuation of an update for a cluster with a matching update strategy that has - paused after completing a segment of the update. + """Update the private endpoint connection for the Azure Relay namespace managed by the specified + cluster manager. Use this operation to approve or reject a pending private endpoint connection + request for the relay namespace managed by the cluster manager. :param resource_group_name: The name of the resource group. 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_continue_update_version_parameters: The request body. Required. - :type cluster_continue_update_version_parameters: - ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_relay_private_endpoint_connection_parameters: The request body. + Default value is None. + :type cluster_manager_update_relay_private_endpoint_connection_parameters: + ~azure.mgmt.networkcloud.models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6715,25 +6990,27 @@ async def begin_continue_update_version( """ @overload - async def begin_continue_update_version( + async def begin_update_relay_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: JSON, + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Trigger the continuation of an update for a cluster with a matching update strategy that has - paused after completing a segment of the update. + """Update the private endpoint connection for the Azure Relay namespace managed by the specified + cluster manager. Use this operation to approve or reject a pending private endpoint connection + request for the relay namespace managed by the cluster manager. :param resource_group_name: The name of the resource group. 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_continue_update_version_parameters: The request body. Required. - :type cluster_continue_update_version_parameters: JSON + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_relay_private_endpoint_connection_parameters: The request body. + Default value is None. + :type cluster_manager_update_relay_private_endpoint_connection_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6745,25 +7022,27 @@ async def begin_continue_update_version( """ @overload - async def begin_continue_update_version( + async def begin_update_relay_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: IO[bytes], + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Trigger the continuation of an update for a cluster with a matching update strategy that has - paused after completing a segment of the update. + """Update the private endpoint connection for the Azure Relay namespace managed by the specified + cluster manager. Use this operation to approve or reject a pending private endpoint connection + request for the relay namespace managed by the cluster manager. :param resource_group_name: The name of the resource group. 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_continue_update_version_parameters: The request body. Required. - :type cluster_continue_update_version_parameters: IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_relay_private_endpoint_connection_parameters: The request body. + Default value is None. + :type cluster_manager_update_relay_private_endpoint_connection_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 @@ -6775,27 +7054,43 @@ async def begin_continue_update_version( """ @distributed_trace_async - async def begin_continue_update_version( + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_manager_name", + "content_type", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + async def begin_update_relay_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: Union[ - _models.ClusterContinueUpdateVersionParameters, JSON, IO[bytes] - ], + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[ + Union[_models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters, JSON, IO[bytes]] + ] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Trigger the continuation of an update for a cluster with a matching update strategy that has - paused after completing a segment of the update. + """Update the private endpoint connection for the Azure Relay namespace managed by the specified + cluster manager. Use this operation to approve or reject a pending private endpoint connection + request for the relay namespace managed by the cluster manager. :param resource_group_name: The name of the resource group. 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_continue_update_version_parameters: The request body. Is one of the following - types: ClusterContinueUpdateVersionParameters, JSON, IO[bytes] Required. - :type cluster_continue_update_version_parameters: - ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters or JSON or IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_relay_private_endpoint_connection_parameters: The request body. + Is one of the following types: ClusterManagerUpdateRelayPrivateEndpointConnectionParameters, + JSON, IO[bytes] Default value is None. + :type cluster_manager_update_relay_private_endpoint_connection_parameters: + ~azure.mgmt.networkcloud.models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters or + JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -6806,15 +7101,16 @@ async def begin_continue_update_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if cluster_manager_update_relay_private_endpoint_connection_parameters else None cls: ClsType[_models.OperationStatusResult] = 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._continue_update_version_initial( + raw_result = await self._update_relay_private_endpoint_connection_initial( resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_continue_update_version_parameters=cluster_continue_update_version_parameters, + cluster_manager_name=cluster_manager_name, + cluster_manager_update_relay_private_endpoint_connection_parameters=cluster_manager_update_relay_private_endpoint_connection_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -6858,13 +7154,37 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _deploy_initial( - self, - resource_group_name: str, - cluster_name: str, - cluster_deploy_parameters: Optional[Union[_models.ClusterDeployParameters, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: + +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.networkcloud.aio.NetworkCloudMgmtClient`'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: NetworkCloudMgmtClientConfiguration = 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 properties of the provided 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.networkcloud.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6873,27 +7193,98 @@ async def _deploy_initial( } 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 + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_parameters: Union[_models.Cluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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)) - content_type = content_type if cluster_deploy_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if cluster_deploy_parameters else None + content_type = content_type or "application/json" _content = None - if isinstance(cluster_deploy_parameters, (IOBase, bytes)): - _content = cluster_deploy_parameters + if isinstance(cluster_parameters, (IOBase, bytes)): + _content = cluster_parameters else: - if cluster_deploy_parameters is not None: - _content = json.dumps(cluster_deploy_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + _content = json.dumps(cluster_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_clusters_deploy_request( + _request = build_clusters_create_or_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6913,7 +7304,7 @@ async def _deploy_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -6926,8 +7317,10 @@ async def _deploy_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -6937,131 +7330,156 @@ async def _deploy_initial( return deserialized # type: ignore @overload - async def begin_deploy( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - cluster_deploy_parameters: Optional[_models.ClusterDeployParameters] = None, + cluster_parameters: _models.Cluster, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Deploy the cluster using the rack configuration provided during creation. + ) -> AsyncLROPoller[_models.Cluster]: + """Create a new cluster or update the properties of the cluster if it exists. :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. - :type cluster_deploy_parameters: ~azure.mgmt.networkcloud.models.ClusterDeployParameters + :param cluster_parameters: The request body. Required. + :type cluster_parameters: ~azure.mgmt.networkcloud.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: An instance of AsyncLROPoller that returns OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_deploy( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - cluster_deploy_parameters: Optional[JSON] = None, + cluster_parameters: JSON, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Deploy the cluster using the rack configuration provided during creation. + ) -> AsyncLROPoller[_models.Cluster]: + """Create a new cluster or update the properties of the cluster if it exists. :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. - :type cluster_deploy_parameters: JSON + :param cluster_parameters: The request body. Required. + :type cluster_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_deploy( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - cluster_deploy_parameters: Optional[IO[bytes]] = None, + cluster_parameters: IO[bytes], *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Deploy the cluster using the rack configuration provided during creation. + ) -> AsyncLROPoller[_models.Cluster]: + """Create a new cluster or update the properties of the cluster if it exists. :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. - :type cluster_deploy_parameters: IO[bytes] + :param cluster_parameters: The request body. Required. + :type cluster_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_deploy( + async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - cluster_deploy_parameters: Optional[Union[_models.ClusterDeployParameters, JSON, IO[bytes]]] = None, + cluster_parameters: Union[_models.Cluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Deploy the cluster using the rack configuration provided during creation. + ) -> AsyncLROPoller[_models.Cluster]: + """Create a new cluster or update the properties of the cluster if it exists. :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Is one of the following types: - ClusterDeployParameters, JSON, IO[bytes] Default value is None. - :type cluster_deploy_parameters: ~azure.mgmt.networkcloud.models.ClusterDeployParameters or - JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :param cluster_parameters: The request body. Is one of the following types: Cluster, JSON, + IO[bytes] Required. + :type cluster_parameters: ~azure.mgmt.networkcloud.models.Cluster or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.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)) - content_type = content_type if cluster_deploy_parameters else None - cls: ClsType[_models.OperationStatusResult] = 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._deploy_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - cluster_deploy_parameters=cluster_deploy_parameters, + cluster_parameters=cluster_parameters, + etag=etag, + match_condition=match_condition, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7072,14 +7490,10 @@ async def begin_deploy( 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.OperationStatusResult, response.json()) + 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 path_format_arguments = { @@ -7095,21 +7509,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.OperationStatusResult].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.OperationStatusResult]( + return AsyncLROPoller[_models.Cluster]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _scan_runtime_initial( + async def _update_initial( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[Union[_models.ClusterScanRuntimeParameters, JSON, IO[bytes]]] = None, + cluster_update_parameters: Optional[Union[_models.ClusterPatchParameters, JSON, IO[bytes]]] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -7118,29 +7535,37 @@ async def _scan_runtime_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError 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)) - content_type = content_type if cluster_scan_runtime_parameters else None + content_type = content_type if cluster_update_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if cluster_scan_runtime_parameters else None + content_type = content_type or "application/json" if cluster_update_parameters else None _content = None - if isinstance(cluster_scan_runtime_parameters, (IOBase, bytes)): - _content = cluster_scan_runtime_parameters + if isinstance(cluster_update_parameters, (IOBase, bytes)): + _content = cluster_update_parameters else: - if cluster_scan_runtime_parameters is not None: - _content = json.dumps(cluster_scan_runtime_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if cluster_update_parameters is not None: + _content = json.dumps(cluster_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_clusters_scan_runtime_request( + _request = build_clusters_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7160,7 +7585,7 @@ async def _scan_runtime_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -7173,8 +7598,11 @@ async def _scan_runtime_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + 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")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -7184,136 +7612,162 @@ async def _scan_runtime_initial( return deserialized # type: ignore @overload - async def begin_scan_runtime( + async def begin_update( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[_models.ClusterScanRuntimeParameters] = None, + cluster_update_parameters: Optional[_models.ClusterPatchParameters] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in - accordance with the cluster configuration. + ) -> AsyncLROPoller[_models.Cluster]: + """Patch the properties of the provided cluster, or update the tags associated with the cluster. + Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. - :type cluster_scan_runtime_parameters: - ~azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters + :param cluster_update_parameters: The request body. Default value is None. + :type cluster_update_parameters: ~azure.mgmt.networkcloud.models.ClusterPatchParameters :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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_scan_runtime( + async def begin_update( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[JSON] = None, + cluster_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in - accordance with the cluster configuration. + ) -> AsyncLROPoller[_models.Cluster]: + """Patch the properties of the provided cluster, or update the tags associated with the cluster. + Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. - :type cluster_scan_runtime_parameters: JSON + :param cluster_update_parameters: The request body. Default value is None. + :type cluster_update_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_scan_runtime( + async def begin_update( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[IO[bytes]] = None, + cluster_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in - accordance with the cluster configuration. + ) -> AsyncLROPoller[_models.Cluster]: + """Patch the properties of the provided cluster, or update the tags associated with the cluster. + Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. - :type cluster_scan_runtime_parameters: IO[bytes] + :param cluster_update_parameters: The request body. Default value is None. + :type cluster_update_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_scan_runtime( + async def begin_update( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[Union[_models.ClusterScanRuntimeParameters, JSON, IO[bytes]]] = None, + cluster_update_parameters: Optional[Union[_models.ClusterPatchParameters, JSON, IO[bytes]]] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in - accordance with the cluster configuration. + ) -> AsyncLROPoller[_models.Cluster]: + """Patch the properties of the provided cluster, or update the tags associated with the cluster. + Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Is one of the following types: - ClusterScanRuntimeParameters, JSON, IO[bytes] Default value is None. - :type cluster_scan_runtime_parameters: - ~azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :param cluster_update_parameters: The request body. Is one of the following types: + ClusterPatchParameters, JSON, IO[bytes] Default value is None. + :type cluster_update_parameters: ~azure.mgmt.networkcloud.models.ClusterPatchParameters or JSON + or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.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)) - content_type = content_type if cluster_scan_runtime_parameters else None - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + content_type = content_type if cluster_update_parameters else 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._scan_runtime_initial( + raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - cluster_scan_runtime_parameters=cluster_scan_runtime_parameters, + cluster_update_parameters=cluster_update_parameters, + etag=etag, + match_condition=match_condition, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7324,14 +7778,10 @@ async def begin_scan_runtime( 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.OperationStatusResult, response.json()) + 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 path_format_arguments = { @@ -7347,21 +7797,2948 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.OperationStatusResult].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.OperationStatusResult]( + return AsyncLROPoller[_models.Cluster]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _update_version_initial( + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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, + etag=etag, + match_condition=match_condition, + 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")) + + 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, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Delete the provided 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 etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = 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, + etag=etag, + match_condition=match_condition, + 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")) + + deserialized = _deserialize(_models.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Cluster"]: + """Get a list of clusters in the provided resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.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, + top=top, + skip_token=skip_token, + 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, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Cluster"]: + """Get a list of clusters in the provided subscription. + + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.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, + top=top, + skip_token=skip_token, + 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 _continue_update_version_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: Union[ + _models.ClusterContinueUpdateVersionParameters, 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(cluster_continue_update_version_parameters, (IOBase, bytes)): + _content = cluster_continue_update_version_parameters + else: + _content = json.dumps(cluster_continue_update_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_continue_update_version_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["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_continue_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: _models.ClusterContinueUpdateVersionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Trigger the continuation of an update for a cluster with a matching update strategy that has + paused after completing a segment of the 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 cluster_continue_update_version_parameters: The request body. Required. + :type cluster_continue_update_version_parameters: + ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters + :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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_continue_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Trigger the continuation of an update for a cluster with a matching update strategy that has + paused after completing a segment of the 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 cluster_continue_update_version_parameters: The request body. Required. + :type cluster_continue_update_version_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_continue_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Trigger the continuation of an update for a cluster with a matching update strategy that has + paused after completing a segment of the 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 cluster_continue_update_version_parameters: The request body. Required. + :type cluster_continue_update_version_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_continue_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: Union[ + _models.ClusterContinueUpdateVersionParameters, JSON, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Trigger the continuation of an update for a cluster with a matching update strategy that has + paused after completing a segment of the 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 cluster_continue_update_version_parameters: The request body. Is one of the following + types: ClusterContinueUpdateVersionParameters, JSON, IO[bytes] Required. + :type cluster_continue_update_version_parameters: + ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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.OperationStatusResult] = 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._continue_update_version_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_continue_update_version_parameters=cluster_continue_update_version_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _deploy_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[Union[_models.ClusterDeployParameters, JSON, IO[bytes]]] = None, + **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)) + content_type = content_type if cluster_deploy_parameters else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if cluster_deploy_parameters else None + _content = None + if isinstance(cluster_deploy_parameters, (IOBase, bytes)): + _content = cluster_deploy_parameters + else: + if cluster_deploy_parameters is not None: + _content = json.dumps(cluster_deploy_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_clusters_deploy_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["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_deploy( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[_models.ClusterDeployParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Deploy the cluster using the rack configuration provided during creation. + + :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. + :type cluster_deploy_parameters: ~azure.mgmt.networkcloud.models.ClusterDeployParameters + :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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_deploy( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Deploy the cluster using the rack configuration provided during creation. + + :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. + :type cluster_deploy_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_deploy( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Deploy the cluster using the rack configuration provided during creation. + + :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. + :type cluster_deploy_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_deploy( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[Union[_models.ClusterDeployParameters, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Deploy the cluster using the rack configuration provided during creation. + + :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Is one of the following types: + ClusterDeployParameters, JSON, IO[bytes] Default value is None. + :type cluster_deploy_parameters: ~azure.mgmt.networkcloud.models.ClusterDeployParameters or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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)) + content_type = content_type if cluster_deploy_parameters else None + cls: ClsType[_models.OperationStatusResult] = 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._deploy_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_deploy_parameters=cluster_deploy_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "content_type", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + async def _inspect_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[Union[_models.ClusterInspectParameters, JSON, IO[bytes]]] = None, + **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)) + content_type = content_type if cluster_inspect_parameters else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if cluster_inspect_parameters else None + _content = None + if isinstance(cluster_inspect_parameters, (IOBase, bytes)): + _content = cluster_inspect_parameters + else: + if cluster_inspect_parameters is not None: + _content = json.dumps(cluster_inspect_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_clusters_inspect_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["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_inspect( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[_models.ClusterInspectParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Trigger an inspection of the cluster to perform validation and optional corrective actions + based on the supplied additional actions and filters. + + :param resource_group_name: The name of the resource group. 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_inspect_parameters: The request body. Default value is None. + :type cluster_inspect_parameters: ~azure.mgmt.networkcloud.models.ClusterInspectParameters + :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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_inspect( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Trigger an inspection of the cluster to perform validation and optional corrective actions + based on the supplied additional actions and filters. + + :param resource_group_name: The name of the resource group. 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_inspect_parameters: The request body. Default value is None. + :type cluster_inspect_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_inspect( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Trigger an inspection of the cluster to perform validation and optional corrective actions + based on the supplied additional actions and filters. + + :param resource_group_name: The name of the resource group. 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_inspect_parameters: The request body. Default value is None. + :type cluster_inspect_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "content_type", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + async def begin_inspect( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[Union[_models.ClusterInspectParameters, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Trigger an inspection of the cluster to perform validation and optional corrective actions + based on the supplied additional actions and filters. + + :param resource_group_name: The name of the resource group. 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_inspect_parameters: The request body. Is one of the following types: + ClusterInspectParameters, JSON, IO[bytes] Default value is None. + :type cluster_inspect_parameters: ~azure.mgmt.networkcloud.models.ClusterInspectParameters or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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)) + content_type = content_type if cluster_inspect_parameters else None + cls: ClsType[_models.OperationStatusResult] = 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._inspect_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_inspect_parameters=cluster_inspect_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "content_type", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def _rotate_credential_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.ClusterRotateCredentialParameters, 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_rotate_credential_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["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_rotate_credential( + self, + resource_group_name: str, + cluster_name: str, + body: _models.ClusterRotateCredentialParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Rotate the specified cluster credential. + + :param resource_group_name: The name of the resource group. 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.networkcloud.models.ClusterRotateCredentialParameters + :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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_rotate_credential( + self, + resource_group_name: str, + cluster_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Rotate the specified cluster credential. + + :param resource_group_name: The name of the resource group. 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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_rotate_credential( + self, + resource_group_name: str, + cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Rotate the specified cluster credential. + + :param resource_group_name: The name of the resource group. 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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "content_type", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def begin_rotate_credential( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.ClusterRotateCredentialParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Rotate the specified cluster credential. + + :param resource_group_name: The name of the resource group. 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: + ClusterRotateCredentialParameters, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.networkcloud.models.ClusterRotateCredentialParameters or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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.OperationStatusResult] = 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._rotate_credential_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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _scan_runtime_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[Union[_models.ClusterScanRuntimeParameters, JSON, IO[bytes]]] = None, + **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)) + content_type = content_type if cluster_scan_runtime_parameters else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if cluster_scan_runtime_parameters else None + _content = None + if isinstance(cluster_scan_runtime_parameters, (IOBase, bytes)): + _content = cluster_scan_runtime_parameters + else: + if cluster_scan_runtime_parameters is not None: + _content = json.dumps(cluster_scan_runtime_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_clusters_scan_runtime_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["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_scan_runtime( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[_models.ClusterScanRuntimeParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in + accordance with the cluster configuration. + + :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. + :type cluster_scan_runtime_parameters: + ~azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters + :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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_scan_runtime( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in + accordance with the cluster configuration. + + :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. + :type cluster_scan_runtime_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_scan_runtime( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in + accordance with the cluster configuration. + + :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. + :type cluster_scan_runtime_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_scan_runtime( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[Union[_models.ClusterScanRuntimeParameters, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in + accordance with the cluster configuration. + + :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Is one of the following types: + ClusterScanRuntimeParameters, JSON, IO[bytes] Default value is None. + :type cluster_scan_runtime_parameters: + ~azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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)) + content_type = content_type if cluster_scan_runtime_parameters else None + cls: ClsType[_models.OperationStatusResult] = 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._scan_runtime_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_scan_runtime_parameters=cluster_scan_runtime_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_version_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: Union[_models.ClusterUpdateVersionParameters, 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(cluster_update_version_parameters, (IOBase, bytes)): + _content = cluster_update_version_parameters + else: + _content = json.dumps(cluster_update_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_version_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["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_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: _models.ClusterUpdateVersionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Update the version of the provided cluster to one of the available supported versions. + + :param resource_group_name: The name of the resource group. 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_update_version_parameters: The request body. Required. + :type cluster_update_version_parameters: + ~azure.mgmt.networkcloud.models.ClusterUpdateVersionParameters + :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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Update the version of the provided cluster to one of the available supported versions. + + :param resource_group_name: The name of the resource group. 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_update_version_parameters: The request body. Required. + :type cluster_update_version_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Update the version of the provided cluster to one of the available supported versions. + + :param resource_group_name: The name of the resource group. 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_update_version_parameters: The request body. Required. + :type cluster_update_version_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 OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: Union[_models.ClusterUpdateVersionParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Update the version of the provided cluster to one of the available supported versions. + + :param resource_group_name: The name of the resource group. 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_update_version_parameters: The request body. Is one of the following types: + ClusterUpdateVersionParameters, JSON, IO[bytes] Required. + :type cluster_update_version_parameters: + ~azure.mgmt.networkcloud.models.ClusterUpdateVersionParameters or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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.OperationStatusResult] = 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_version_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_update_version_parameters=cluster_update_version_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class KubernetesClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.networkcloud.aio.NetworkCloudMgmtClient`'s + :attr:`kubernetes_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: NetworkCloudMgmtClientConfiguration = 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, kubernetes_cluster_name: str, **kwargs: Any + ) -> _models.KubernetesCluster: + """Get properties of the provided the Kubernetes cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :return: KubernetesCluster. The KubernetesCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.KubernetesCluster + :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.KubernetesCluster] = kwargs.pop("cls", None) + + _request = build_kubernetes_clusters_get_request( + resource_group_name=resource_group_name, + kubernetes_cluster_name=kubernetes_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.KubernetesCluster, 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, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: Union[_models.KubernetesCluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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(kubernetes_cluster_parameters, (IOBase, bytes)): + _content = kubernetes_cluster_parameters + else: + _content = json.dumps(kubernetes_cluster_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_kubernetes_clusters_create_or_update_request( + resource_group_name=resource_group_name, + kubernetes_cluster_name=kubernetes_cluster_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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") + ) + + 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, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: _models.KubernetesCluster, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.KubernetesCluster]: + """Create a new Kubernetes cluster or update the properties of the existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_parameters: The request body. Required. + :type kubernetes_cluster_parameters: ~azure.mgmt.networkcloud.models.KubernetesCluster + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.KubernetesCluster]: + """Create a new Kubernetes cluster or update the properties of the existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_parameters: The request body. Required. + :type kubernetes_cluster_parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.KubernetesCluster]: + """Create a new Kubernetes cluster or update the properties of the existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_parameters: The request body. Required. + :type kubernetes_cluster_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 + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: Union[_models.KubernetesCluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.KubernetesCluster]: + """Create a new Kubernetes cluster or update the properties of the existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_parameters: The request body. Is one of the following types: + KubernetesCluster, JSON, IO[bytes] Required. + :type kubernetes_cluster_parameters: ~azure.mgmt.networkcloud.models.KubernetesCluster or JSON + or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :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.KubernetesCluster] = 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, + kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_cluster_parameters=kubernetes_cluster_parameters, + etag=etag, + match_condition=match_condition, + 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.KubernetesCluster, 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.KubernetesCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.KubernetesCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[ + Union[_models.KubernetesClusterPatchParameters, JSON, IO[bytes]] + ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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)) + content_type = content_type if kubernetes_cluster_update_parameters else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if kubernetes_cluster_update_parameters else None + _content = None + if isinstance(kubernetes_cluster_update_parameters, (IOBase, bytes)): + _content = kubernetes_cluster_update_parameters + else: + if kubernetes_cluster_update_parameters is not None: + _content = json.dumps(kubernetes_cluster_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_kubernetes_clusters_update_request( + resource_group_name=resource_group_name, + kubernetes_cluster_name=kubernetes_cluster_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + 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, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[_models.KubernetesClusterPatchParameters] = None, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.KubernetesCluster]: + """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the + Kubernetes cluster. Properties and tag updates can be done independently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_update_parameters: The request body. Default value is None. + :type kubernetes_cluster_update_parameters: + ~azure.mgmt.networkcloud.models.KubernetesClusterPatchParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.KubernetesCluster]: + """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the + Kubernetes cluster. Properties and tag updates can be done independently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_update_parameters: The request body. Default value is None. + :type kubernetes_cluster_update_parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.KubernetesCluster]: + """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the + Kubernetes cluster. Properties and tag updates can be done independently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_update_parameters: The request body. Default value is None. + :type kubernetes_cluster_update_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 + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[ + Union[_models.KubernetesClusterPatchParameters, JSON, IO[bytes]] + ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.KubernetesCluster]: + """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the + Kubernetes cluster. Properties and tag updates can be done independently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_update_parameters: The request body. Is one of the following types: + KubernetesClusterPatchParameters, JSON, IO[bytes] Default value is None. + :type kubernetes_cluster_update_parameters: + ~azure.mgmt.networkcloud.models.KubernetesClusterPatchParameters or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :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)) + content_type = content_type if kubernetes_cluster_update_parameters else None + cls: ClsType[_models.KubernetesCluster] = 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, + kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_cluster_update_parameters=kubernetes_cluster_update_parameters, + etag=etag, + match_condition=match_condition, + 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.KubernetesCluster, 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.KubernetesCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.KubernetesCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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_kubernetes_clusters_delete_request( + resource_group_name=resource_group_name, + kubernetes_cluster_name=kubernetes_cluster_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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")) + + 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, + kubernetes_cluster_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.OperationStatusResult]: + """Delete the provided Kubernetes cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns OperationStatusResult. The + OperationStatusResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = 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, + kubernetes_cluster_name=kubernetes_cluster_name, + etag=etag, + match_condition=match_condition, + 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")) + + deserialized = _deserialize(_models.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.KubernetesCluster"]: + """Get a list of Kubernetes clusters in the provided resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of KubernetesCluster + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.KubernetesCluster]] = 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_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + 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.KubernetesCluster], + 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, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.KubernetesCluster"]: + """Get a list of Kubernetes clusters in the provided subscription. + + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of KubernetesCluster + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.KubernetesCluster]] = 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_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + 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.KubernetesCluster], + 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 _restart_node_initial( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: Union[_models.ClusterUpdateVersionParameters, JSON, IO[bytes]], + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: Union[ + _models.KubernetesClusterRestartNodeParameters, JSON, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -7380,14 +10757,14 @@ async def _update_version_initial( content_type = content_type or "application/json" _content = None - if isinstance(cluster_update_version_parameters, (IOBase, bytes)): - _content = cluster_update_version_parameters + if isinstance(kubernetes_cluster_restart_node_parameters, (IOBase, bytes)): + _content = kubernetes_cluster_restart_node_parameters else: - _content = json.dumps(cluster_update_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(kubernetes_cluster_restart_node_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_clusters_update_version_request( + _request = build_kubernetes_clusters_restart_node_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + kubernetes_cluster_name=kubernetes_cluster_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -7432,25 +10809,25 @@ async def _update_version_initial( return deserialized # type: ignore @overload - async def begin_update_version( + async def begin_restart_node( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: _models.ClusterUpdateVersionParameters, + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: _models.KubernetesClusterRestartNodeParameters, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Update the version of the provided cluster to one of the available supported versions. + """Restart a targeted node of a Kubernetes 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_update_version_parameters: The request body. Required. - :type cluster_update_version_parameters: - ~azure.mgmt.networkcloud.models.ClusterUpdateVersionParameters + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_restart_node_parameters: The request body. Required. + :type kubernetes_cluster_restart_node_parameters: + ~azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7462,24 +10839,24 @@ async def begin_update_version( """ @overload - async def begin_update_version( + async def begin_restart_node( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: JSON, + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Update the version of the provided cluster to one of the available supported versions. + """Restart a targeted node of a Kubernetes 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_update_version_parameters: The request body. Required. - :type cluster_update_version_parameters: JSON + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_restart_node_parameters: The request body. Required. + :type kubernetes_cluster_restart_node_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7491,24 +10868,24 @@ async def begin_update_version( """ @overload - async def begin_update_version( + async def begin_restart_node( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: IO[bytes], + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Update the version of the provided cluster to one of the available supported versions. + """Restart a targeted node of a Kubernetes 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_update_version_parameters: The request body. Required. - :type cluster_update_version_parameters: IO[bytes] + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_restart_node_parameters: The request body. Required. + :type kubernetes_cluster_restart_node_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 @@ -7520,24 +10897,26 @@ async def begin_update_version( """ @distributed_trace_async - async def begin_update_version( + async def begin_restart_node( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: Union[_models.ClusterUpdateVersionParameters, JSON, IO[bytes]], + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: Union[ + _models.KubernetesClusterRestartNodeParameters, JSON, IO[bytes] + ], **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Update the version of the provided cluster to one of the available supported versions. + """Restart a targeted node of a Kubernetes 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_update_version_parameters: The request body. Is one of the following types: - ClusterUpdateVersionParameters, JSON, IO[bytes] Required. - :type cluster_update_version_parameters: - ~azure.mgmt.networkcloud.models.ClusterUpdateVersionParameters or JSON or IO[bytes] + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_restart_node_parameters: The request body. Is one of the following + types: KubernetesClusterRestartNodeParameters, JSON, IO[bytes] Required. + :type kubernetes_cluster_restart_node_parameters: + ~azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: @@ -7553,10 +10932,10 @@ async def begin_update_version( 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_version_initial( + raw_result = await self._restart_node_initial( resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_update_version_parameters=cluster_update_version_parameters, + kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_cluster_restart_node_parameters=kubernetes_cluster_restart_node_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7601,14 +10980,14 @@ def get_long_running_output(pipeline_response): ) -class KubernetesClustersOperations: +class KubernetesVersionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.networkcloud.aio.NetworkCloudMgmtClient`'s - :attr:`kubernetes_clusters` attribute. + :attr:`kubernetes_versions` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -7619,18 +10998,32 @@ 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-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def get( - self, resource_group_name: str, kubernetes_cluster_name: str, **kwargs: Any - ) -> _models.KubernetesCluster: - """Get properties of the provided the Kubernetes cluster. + self, resource_group_name: str, kubernetes_version_name: str, **kwargs: Any + ) -> _models.KubernetesVersion: + """Retrieve the Kubernetes version resource that describes the available Kubernetes versions for + deployment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :return: KubernetesCluster. The KubernetesCluster is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.KubernetesCluster + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :return: KubernetesVersion. The KubernetesVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.KubernetesVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7644,11 +11037,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.KubernetesCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.KubernetesVersion] = kwargs.pop("cls", None) - _request = build_kubernetes_clusters_get_request( + _request = build_kubernetes_versions_get_request( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -7683,18 +11076,34 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.KubernetesCluster, response.json()) + deserialized = _deserialize(_models.KubernetesVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def _create_or_update_initial( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: Union[_models.KubernetesCluster, JSON, IO[bytes]], + kubernetes_version_name: str, + kubernetes_version_parameters: Union[_models.KubernetesVersion, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -7722,14 +11131,14 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(kubernetes_cluster_parameters, (IOBase, bytes)): - _content = kubernetes_cluster_parameters + if isinstance(kubernetes_version_parameters, (IOBase, bytes)): + _content = kubernetes_version_parameters else: - _content = json.dumps(kubernetes_cluster_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(kubernetes_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_kubernetes_clusters_create_or_update_request( + _request = build_kubernetes_versions_create_or_update_request( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -7781,23 +11190,24 @@ async def _create_or_update_initial( async def begin_create_or_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: _models.KubernetesCluster, + kubernetes_version_name: str, + kubernetes_version_parameters: _models.KubernetesVersion, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.KubernetesCluster]: - """Create a new Kubernetes cluster or update the properties of the existing one. + ) -> AsyncLROPoller[_models.KubernetesVersion]: + """Create the Kubernetes version resource or update its tags. This resource is system managed and + should only be created with the name "default". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_parameters: The request body. Required. - :type kubernetes_cluster_parameters: ~azure.mgmt.networkcloud.models.KubernetesCluster + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_parameters: The request body. Required. + :type kubernetes_version_parameters: ~azure.mgmt.networkcloud.models.KubernetesVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7806,9 +11216,9 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of AsyncLROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7816,23 +11226,24 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: JSON, + kubernetes_version_name: str, + kubernetes_version_parameters: JSON, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.KubernetesCluster]: - """Create a new Kubernetes cluster or update the properties of the existing one. + ) -> AsyncLROPoller[_models.KubernetesVersion]: + """Create the Kubernetes version resource or update its tags. This resource is system managed and + should only be created with the name "default". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_parameters: The request body. Required. - :type kubernetes_cluster_parameters: JSON + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_parameters: The request body. Required. + :type kubernetes_version_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7841,9 +11252,9 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of AsyncLROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7851,23 +11262,24 @@ async def begin_create_or_update( async def begin_create_or_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: IO[bytes], + kubernetes_version_name: str, + kubernetes_version_parameters: IO[bytes], *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.KubernetesCluster]: - """Create a new Kubernetes cluster or update the properties of the existing one. + ) -> AsyncLROPoller[_models.KubernetesVersion]: + """Create the Kubernetes version resource or update its tags. This resource is system managed and + should only be created with the name "default". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_parameters: The request body. Required. - :type kubernetes_cluster_parameters: IO[bytes] + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_parameters: The request body. Required. + :type kubernetes_version_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 @@ -7876,57 +11288,74 @@ async def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of AsyncLROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def begin_create_or_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: Union[_models.KubernetesCluster, JSON, IO[bytes]], + kubernetes_version_name: str, + kubernetes_version_parameters: Union[_models.KubernetesVersion, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.KubernetesCluster]: - """Create a new Kubernetes cluster or update the properties of the existing one. + ) -> AsyncLROPoller[_models.KubernetesVersion]: + """Create the Kubernetes version resource or update its tags. This resource is system managed and + should only be created with the name "default". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_parameters: The request body. Is one of the following types: - KubernetesCluster, JSON, IO[bytes] Required. - :type kubernetes_cluster_parameters: ~azure.mgmt.networkcloud.models.KubernetesCluster or JSON + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_parameters: The request body. Is one of the following types: + KubernetesVersion, JSON, IO[bytes] Required. + :type kubernetes_version_parameters: ~azure.mgmt.networkcloud.models.KubernetesVersion or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of AsyncLROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :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.KubernetesCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.KubernetesVersion] = 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, - kubernetes_cluster_name=kubernetes_cluster_name, - kubernetes_cluster_parameters=kubernetes_cluster_parameters, + kubernetes_version_name=kubernetes_version_name, + kubernetes_version_parameters=kubernetes_version_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -7940,7 +11369,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.KubernetesCluster, response.json()) + deserialized = _deserialize(_models.KubernetesVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -7958,22 +11387,38 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.KubernetesCluster].from_continuation_token( + return AsyncLROPoller[_models.KubernetesVersion].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.KubernetesCluster]( + return AsyncLROPoller[_models.KubernetesVersion]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def _update_initial( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[ - Union[_models.KubernetesClusterPatchParameters, JSON, IO[bytes]] + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[ + Union[_models.KubernetesVersionPatchParameters, JSON, IO[bytes]] ] = None, *, etag: Optional[str] = None, @@ -7998,22 +11443,22 @@ async def _update_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if kubernetes_cluster_update_parameters else None + content_type = content_type if kubernetes_version_patch_parameters else None cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if kubernetes_cluster_update_parameters else None + content_type = content_type or "application/json" if kubernetes_version_patch_parameters else None _content = None - if isinstance(kubernetes_cluster_update_parameters, (IOBase, bytes)): - _content = kubernetes_cluster_update_parameters + if isinstance(kubernetes_version_patch_parameters, (IOBase, bytes)): + _content = kubernetes_version_patch_parameters else: - if kubernetes_cluster_update_parameters is not None: - _content = json.dumps(kubernetes_cluster_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if kubernetes_version_patch_parameters is not None: + _content = json.dumps(kubernetes_version_patch_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_kubernetes_clusters_update_request( + _request = build_kubernetes_versions_update_request( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -8066,25 +11511,25 @@ async def _update_initial( async def begin_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[_models.KubernetesClusterPatchParameters] = None, + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[_models.KubernetesVersionPatchParameters] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.KubernetesCluster]: - """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the - Kubernetes cluster. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.KubernetesVersion]: + """Update tags associated with the Kubernetes version resource. No other properties are supported + for update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_update_parameters: The request body. Default value is None. - :type kubernetes_cluster_update_parameters: - ~azure.mgmt.networkcloud.models.KubernetesClusterPatchParameters + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_patch_parameters: The request body. Default value is None. + :type kubernetes_version_patch_parameters: + ~azure.mgmt.networkcloud.models.KubernetesVersionPatchParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8093,9 +11538,9 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of AsyncLROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8103,24 +11548,24 @@ async def begin_update( async def begin_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[JSON] = None, + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[JSON] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.KubernetesCluster]: - """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the - Kubernetes cluster. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.KubernetesVersion]: + """Update tags associated with the Kubernetes version resource. No other properties are supported + for update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_update_parameters: The request body. Default value is None. - :type kubernetes_cluster_update_parameters: JSON + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_patch_parameters: The request body. Default value is None. + :type kubernetes_version_patch_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -8129,9 +11574,9 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of AsyncLROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8139,24 +11584,24 @@ async def begin_update( async def begin_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[IO[bytes]] = None, + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.KubernetesCluster]: - """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the - Kubernetes cluster. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.KubernetesVersion]: + """Update tags associated with the Kubernetes version resource. No other properties are supported + for update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_update_parameters: The request body. Default value is None. - :type kubernetes_cluster_update_parameters: IO[bytes] + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_patch_parameters: The request body. Default value is None. + :type kubernetes_version_patch_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 @@ -8165,61 +11610,77 @@ async def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of AsyncLROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def begin_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[ - Union[_models.KubernetesClusterPatchParameters, JSON, IO[bytes]] + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[ + Union[_models.KubernetesVersionPatchParameters, JSON, IO[bytes]] ] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> AsyncLROPoller[_models.KubernetesCluster]: - """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the - Kubernetes cluster. Properties and tag updates can be done independently. + ) -> AsyncLROPoller[_models.KubernetesVersion]: + """Update tags associated with the Kubernetes version resource. No other properties are supported + for update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_update_parameters: The request body. Is one of the following types: - KubernetesClusterPatchParameters, JSON, IO[bytes] Default value is None. - :type kubernetes_cluster_update_parameters: - ~azure.mgmt.networkcloud.models.KubernetesClusterPatchParameters or JSON or IO[bytes] + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_patch_parameters: The request body. Is one of the following types: + KubernetesVersionPatchParameters, JSON, IO[bytes] Default value is None. + :type kubernetes_version_patch_parameters: + ~azure.mgmt.networkcloud.models.KubernetesVersionPatchParameters or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of AsyncLROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :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)) - content_type = content_type if kubernetes_cluster_update_parameters else None - cls: ClsType[_models.KubernetesCluster] = kwargs.pop("cls", None) + content_type = content_type if kubernetes_version_patch_parameters else None + cls: ClsType[_models.KubernetesVersion] = 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, - kubernetes_cluster_name=kubernetes_cluster_name, - kubernetes_cluster_update_parameters=kubernetes_cluster_update_parameters, + kubernetes_version_name=kubernetes_version_name, + kubernetes_version_patch_parameters=kubernetes_version_patch_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -8233,7 +11694,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.KubernetesCluster, response.json()) + deserialized = _deserialize(_models.KubernetesVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -8251,20 +11712,34 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.KubernetesCluster].from_continuation_token( + return AsyncLROPoller[_models.KubernetesVersion].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.KubernetesCluster]( + return AsyncLROPoller[_models.KubernetesVersion]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def _delete_initial( self, resource_group_name: str, - kubernetes_cluster_name: str, + kubernetes_version_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -8289,9 +11764,9 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_kubernetes_clusters_delete_request( + _request = build_kubernetes_versions_delete_request( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -8336,22 +11811,36 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) async def begin_delete( self, resource_group_name: str, - kubernetes_cluster_name: str, + kubernetes_version_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Delete the provided Kubernetes cluster. + """Delete the specified Kubernetes version resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -8373,7 +11862,7 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, etag=etag, match_condition=match_condition, cls=lambda x, y, z: x, @@ -8418,10 +11907,24 @@ def get_long_running_output(pipeline_response): ) @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "top", + "skip_token", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def list_by_resource_group( self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.KubernetesCluster"]: - """Get a list of Kubernetes clusters in the provided resource group. + ) -> AsyncItemPaged["_models.KubernetesVersion"]: + """Get a list of Kubernetes version resources in the provided resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8433,15 +11936,15 @@ def list_by_resource_group( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of KubernetesCluster + :return: An iterator like instance of KubernetesVersion :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.KubernetesCluster] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.KubernetesCluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.KubernetesVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8454,7 +11957,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_kubernetes_clusters_list_by_resource_group_request( + _request = build_kubernetes_versions_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, top=top, @@ -8495,7 +11998,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.KubernetesCluster], + List[_models.KubernetesVersion], deserialized.get("value", []), ) if cls: @@ -8524,10 +12027,15 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={"2026-01-01-preview": ["api_version", "subscription_id", "top", "skip_token", "accept"]}, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def list_by_subscription( self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.KubernetesCluster"]: - """Get a list of Kubernetes clusters in the provided subscription. + ) -> AsyncItemPaged["_models.KubernetesVersion"]: + """Get a list of Kubernetes version resources in the provided subscription. :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -8536,15 +12044,15 @@ def list_by_subscription( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of KubernetesCluster + :return: An iterator like instance of KubernetesVersion :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.KubernetesCluster] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.KubernetesCluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.KubernetesVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8557,7 +12065,7 @@ def list_by_subscription( def prepare_request(next_link=None): if not next_link: - _request = build_kubernetes_clusters_list_by_subscription_request( + _request = build_kubernetes_versions_list_by_subscription_request( subscription_id=self._config.subscription_id, top=top, skip_token=skip_token, @@ -8597,7 +12105,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.KubernetesCluster], + List[_models.KubernetesVersion], deserialized.get("value", []), ) if cls: @@ -8625,253 +12133,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - async def _restart_node_initial( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: Union[ - _models.KubernetesClusterRestartNodeParameters, 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(kubernetes_cluster_restart_node_parameters, (IOBase, bytes)): - _content = kubernetes_cluster_restart_node_parameters - else: - _content = json.dumps(kubernetes_cluster_restart_node_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_kubernetes_clusters_restart_node_request( - resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_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["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_restart_node( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: _models.KubernetesClusterRestartNodeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Restart a targeted node of a Kubernetes cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_restart_node_parameters: The request body. Required. - :type kubernetes_cluster_restart_node_parameters: - ~azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters - :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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_restart_node( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Restart a targeted node of a Kubernetes cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_restart_node_parameters: The request body. Required. - :type kubernetes_cluster_restart_node_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_restart_node( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Restart a targeted node of a Kubernetes cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_restart_node_parameters: The request body. Required. - :type kubernetes_cluster_restart_node_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 OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_restart_node( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: Union[ - _models.KubernetesClusterRestartNodeParameters, JSON, IO[bytes] - ], - **kwargs: Any - ) -> AsyncLROPoller[_models.OperationStatusResult]: - """Restart a targeted node of a Kubernetes cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_restart_node_parameters: The request body. Is one of the following - types: KubernetesClusterRestartNodeParameters, JSON, IO[bytes] Required. - :type kubernetes_cluster_restart_node_parameters: - ~azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns OperationStatusResult. The - OperationStatusResult is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :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.OperationStatusResult] = 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._restart_node_initial( - resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, - kubernetes_cluster_restart_node_parameters=kubernetes_cluster_restart_node_parameters, - 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OperationStatusResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - class L2NetworksOperations: """ diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/__init__.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/__init__.py index 6e71f11bab4a..0d1972f54d98 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/__init__.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/__init__.py @@ -15,6 +15,12 @@ from ._models import ( # type: ignore AadConfiguration, + AccessBridge, + AccessBridgeEndpoint, + AccessBridgePatchParameters, + AccessBridgePatchProperties, + AccessBridgeProperties, + AccessBridgeSecurityRule, ActionState, AdministrativeCredentials, AdministratorConfiguration, @@ -36,10 +42,12 @@ BareMetalMachineKeySetPatchParameters, BareMetalMachineKeySetPatchProperties, BareMetalMachineKeySetProperties, + BareMetalMachineMonitoringConfigurationStatus, BareMetalMachinePatchParameters, BareMetalMachinePatchProperties, BareMetalMachinePowerOffParameters, BareMetalMachineProperties, + BareMetalMachineReimageParameters, BareMetalMachineReplaceParameters, BareMetalMachineRunCommandParameters, BareMetalMachineRunDataExtractsParameters, @@ -64,9 +72,12 @@ ClusterCapacity, ClusterContinueUpdateVersionParameters, ClusterDeployParameters, + ClusterInspectParameters, ClusterManager, ClusterManagerPatchParameters, ClusterManagerProperties, + ClusterManagerRelayConfiguration, + ClusterManagerUpdateRelayPrivateEndpointConnectionParameters, ClusterMetricsConfiguration, ClusterMetricsConfigurationPatchParameters, ClusterMetricsConfigurationPatchProperties, @@ -74,6 +85,7 @@ ClusterPatchParameters, ClusterPatchProperties, ClusterProperties, + ClusterRotateCredentialParameters, ClusterScanRuntimeParameters, ClusterSecretArchive, ClusterUpdateStrategy, @@ -93,6 +105,7 @@ ErrorResponse, ExtendedLocation, FeatureStatus, + FilterDevices, HardwareInventory, HardwareInventoryNetworkInterface, HardwareValidationStatus, @@ -113,6 +126,10 @@ KubernetesClusterProperties, KubernetesClusterRestartNodeParameters, KubernetesLabel, + KubernetesVersion, + KubernetesVersionPatchParameters, + KubernetesVersionProperties, + KubernetesVersionValue, L2Network, L2NetworkAttachmentConfiguration, L2NetworkPatchParameters, @@ -160,6 +177,8 @@ StorageApplianceCommandSpecification, StorageApplianceConfigurationData, StorageApplianceEnableRemoteVendorManagementParameters, + StorageApplianceExpansionShelf, + StorageApplianceMonitoringConfigurationStatus, StorageAppliancePatchParameters, StorageAppliancePatchProperties, StorageApplianceProperties, @@ -191,6 +210,9 @@ ) from ._enums import ( # type: ignore + AccessBridgeAllowedName, + AccessBridgeDetailedStatus, + AccessBridgeProvisioningState, ActionStateStatus, ActionType, AdvertiseToFabric, @@ -206,9 +228,12 @@ BareMetalMachineKeySetPrivilegeLevel, BareMetalMachineKeySetProvisioningState, BareMetalMachineKeySetUserSetupStatus, + BareMetalMachineMetricsConfigurationStatusLogLevel, + BareMetalMachineMetricsConfigurationStatusMetricsLevel, BareMetalMachinePowerState, BareMetalMachineProvisioningState, BareMetalMachineReadyState, + BareMetalMachineReimageSafeguardMode, BareMetalMachineReplaceSafeguardMode, BareMetalMachineReplaceStoragePolicy, BareMetalMachineSkipShutdown, @@ -225,7 +250,9 @@ CloudServicesNetworkStorageStatusStatus, ClusterConnectionStatus, ClusterContinueUpdateVersionMachineGroupTargetingMode, + ClusterContinueUpdateVersionSafeguardMode, ClusterDetailedStatus, + ClusterInspectAdditionalAction, ClusterManagerConnectionStatus, ClusterManagerDetailedStatus, ClusterManagerProvisioningState, @@ -236,6 +263,7 @@ ClusterSecretArchiveEnabled, ClusterType, ClusterUpdateStrategyType, + ClusterUpdateVersionSafeguardMode, CommandOutputType, ConsoleDetailedStatus, ConsoleEnabled, @@ -243,6 +271,7 @@ ControlImpact, CreatedByType, DefaultGateway, + DeploymentType, DeviceConnectionType, DiskType, ExtendedLocationType, @@ -262,6 +291,7 @@ KubernetesNodePowerState, KubernetesNodeRole, KubernetesPluginType, + KubernetesVersionProvisioningState, L2NetworkDetailedStatus, L2NetworkProvisioningState, L3NetworkConfigurationIpamEnabled, @@ -277,14 +307,22 @@ RackProvisioningState, RackSkuProvisioningState, RackSkuType, + RelayPrivateEndpointConnectionState, RelayType, RemoteVendorManagementFeature, RemoteVendorManagementStatus, + RuntimeProtectionAgentHealthStatus, + RuntimeProtectionAgentLicenseStatus, + RuntimeProtectionDefinitionUpdateMode, RuntimeProtectionEnforcementLevel, + SecurityRuleDirection, SkipShutdown, StepStateStatus, StorageApplianceDetailedStatus, + StorageApplianceMetricsConfigurationStatusLogLevel, + StorageApplianceMetricsConfigurationStatusMetricsLevel, StorageApplianceProvisioningState, + TransportProtocol, TrunkedNetworkDetailedStatus, TrunkedNetworkProvisioningState, ValidationThresholdGrouping, @@ -311,6 +349,12 @@ __all__ = [ "AadConfiguration", + "AccessBridge", + "AccessBridgeEndpoint", + "AccessBridgePatchParameters", + "AccessBridgePatchProperties", + "AccessBridgeProperties", + "AccessBridgeSecurityRule", "ActionState", "AdministrativeCredentials", "AdministratorConfiguration", @@ -332,10 +376,12 @@ "BareMetalMachineKeySetPatchParameters", "BareMetalMachineKeySetPatchProperties", "BareMetalMachineKeySetProperties", + "BareMetalMachineMonitoringConfigurationStatus", "BareMetalMachinePatchParameters", "BareMetalMachinePatchProperties", "BareMetalMachinePowerOffParameters", "BareMetalMachineProperties", + "BareMetalMachineReimageParameters", "BareMetalMachineReplaceParameters", "BareMetalMachineRunCommandParameters", "BareMetalMachineRunDataExtractsParameters", @@ -360,9 +406,12 @@ "ClusterCapacity", "ClusterContinueUpdateVersionParameters", "ClusterDeployParameters", + "ClusterInspectParameters", "ClusterManager", "ClusterManagerPatchParameters", "ClusterManagerProperties", + "ClusterManagerRelayConfiguration", + "ClusterManagerUpdateRelayPrivateEndpointConnectionParameters", "ClusterMetricsConfiguration", "ClusterMetricsConfigurationPatchParameters", "ClusterMetricsConfigurationPatchProperties", @@ -370,6 +419,7 @@ "ClusterPatchParameters", "ClusterPatchProperties", "ClusterProperties", + "ClusterRotateCredentialParameters", "ClusterScanRuntimeParameters", "ClusterSecretArchive", "ClusterUpdateStrategy", @@ -389,6 +439,7 @@ "ErrorResponse", "ExtendedLocation", "FeatureStatus", + "FilterDevices", "HardwareInventory", "HardwareInventoryNetworkInterface", "HardwareValidationStatus", @@ -409,6 +460,10 @@ "KubernetesClusterProperties", "KubernetesClusterRestartNodeParameters", "KubernetesLabel", + "KubernetesVersion", + "KubernetesVersionPatchParameters", + "KubernetesVersionProperties", + "KubernetesVersionValue", "L2Network", "L2NetworkAttachmentConfiguration", "L2NetworkPatchParameters", @@ -456,6 +511,8 @@ "StorageApplianceCommandSpecification", "StorageApplianceConfigurationData", "StorageApplianceEnableRemoteVendorManagementParameters", + "StorageApplianceExpansionShelf", + "StorageApplianceMonitoringConfigurationStatus", "StorageAppliancePatchParameters", "StorageAppliancePatchProperties", "StorageApplianceProperties", @@ -484,6 +541,9 @@ "VolumeProperties", "VulnerabilityScanningSettings", "VulnerabilityScanningSettingsPatch", + "AccessBridgeAllowedName", + "AccessBridgeDetailedStatus", + "AccessBridgeProvisioningState", "ActionStateStatus", "ActionType", "AdvertiseToFabric", @@ -499,9 +559,12 @@ "BareMetalMachineKeySetPrivilegeLevel", "BareMetalMachineKeySetProvisioningState", "BareMetalMachineKeySetUserSetupStatus", + "BareMetalMachineMetricsConfigurationStatusLogLevel", + "BareMetalMachineMetricsConfigurationStatusMetricsLevel", "BareMetalMachinePowerState", "BareMetalMachineProvisioningState", "BareMetalMachineReadyState", + "BareMetalMachineReimageSafeguardMode", "BareMetalMachineReplaceSafeguardMode", "BareMetalMachineReplaceStoragePolicy", "BareMetalMachineSkipShutdown", @@ -518,7 +581,9 @@ "CloudServicesNetworkStorageStatusStatus", "ClusterConnectionStatus", "ClusterContinueUpdateVersionMachineGroupTargetingMode", + "ClusterContinueUpdateVersionSafeguardMode", "ClusterDetailedStatus", + "ClusterInspectAdditionalAction", "ClusterManagerConnectionStatus", "ClusterManagerDetailedStatus", "ClusterManagerProvisioningState", @@ -529,6 +594,7 @@ "ClusterSecretArchiveEnabled", "ClusterType", "ClusterUpdateStrategyType", + "ClusterUpdateVersionSafeguardMode", "CommandOutputType", "ConsoleDetailedStatus", "ConsoleEnabled", @@ -536,6 +602,7 @@ "ControlImpact", "CreatedByType", "DefaultGateway", + "DeploymentType", "DeviceConnectionType", "DiskType", "ExtendedLocationType", @@ -555,6 +622,7 @@ "KubernetesNodePowerState", "KubernetesNodeRole", "KubernetesPluginType", + "KubernetesVersionProvisioningState", "L2NetworkDetailedStatus", "L2NetworkProvisioningState", "L3NetworkConfigurationIpamEnabled", @@ -570,14 +638,22 @@ "RackProvisioningState", "RackSkuProvisioningState", "RackSkuType", + "RelayPrivateEndpointConnectionState", "RelayType", "RemoteVendorManagementFeature", "RemoteVendorManagementStatus", + "RuntimeProtectionAgentHealthStatus", + "RuntimeProtectionAgentLicenseStatus", + "RuntimeProtectionDefinitionUpdateMode", "RuntimeProtectionEnforcementLevel", + "SecurityRuleDirection", "SkipShutdown", "StepStateStatus", "StorageApplianceDetailedStatus", + "StorageApplianceMetricsConfigurationStatusLogLevel", + "StorageApplianceMetricsConfigurationStatusMetricsLevel", "StorageApplianceProvisioningState", + "TransportProtocol", "TrunkedNetworkDetailedStatus", "TrunkedNetworkProvisioningState", "ValidationThresholdGrouping", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/_enums.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/_enums.py index 1b6cfa435c8b..716a7950020d 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/_enums.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/_enums.py @@ -11,6 +11,43 @@ from azure.core import CaseInsensitiveEnumMeta +class AccessBridgeAllowedName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The allowed names for the access bridge.""" + + BASTION = "Bastion" + """The access bridge for bare metal machine bastion access.""" + PRIVATE_VAULT = "PrivateVault" + """The access bridge for cluster access to private vault.""" + STORAGE_DASHBOARD = "StorageDashboard" + """The access bridge for access to the storage dashboard.""" + + +class AccessBridgeDetailedStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The detailed status reported by the access bridge.""" + + RUNNING = "Running" + """The access bridge is healthy and operating normally.""" + DEGRADED = "Degraded" + """The access bridge is experiencing degraded performance or partial outages.""" + FAILED = "Failed" + """The access bridge is not operational.""" + + +class AccessBridgeProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the access bridge.""" + + ACCEPTED = "Accepted" + """The Accepted status.""" + CANCELED = "Canceled" + """The Canceled status.""" + FAILED = "Failed" + """The Failed status.""" + PROVISIONING = "Provisioning" + """The Provisioning status.""" + SUCCEEDED = "Succeeded" + """The Succeeded status.""" + + class ActionStateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of the action.""" @@ -188,6 +225,28 @@ class BareMetalMachineKeySetUserSetupStatus(str, Enum, metaclass=CaseInsensitive """The user is not valid and has no access.""" +class BareMetalMachineMetricsConfigurationStatusLogLevel( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The log level for the monitoring configuration status of the bare metal machine.""" + + DEFAULT = "Default" + """Logs are emitted at the default log level.""" + NEXUS = "Nexus" + """Logs are emitted at the Nexus log level.""" + + +class BareMetalMachineMetricsConfigurationStatusMetricsLevel( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The metrics level for the monitoring configuration status of the bare metal machine.""" + + DEFAULT = "Default" + """Metrics are emitted at the default metrics level.""" + NEXUS = "Nexus" + """Metrics are emitted at the Nexus metrics level.""" + + class BareMetalMachinePowerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The power state derived from the baseboard management controller.""" @@ -223,6 +282,18 @@ class BareMetalMachineReadyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The bare metal machine is not ready to receive workloads.""" +class BareMetalMachineReimageSafeguardMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The safeguard mode to use for the reimage action, where None indicates to bypass safeguards and + All indicates to utilize all safeguards. + """ + + ALL = "All" + """Run all pre‑operation validation checks before performing the reimage. If any check fails, the + request is rejected and no changes are made.""" + NONE = "None" + """Skip all safeguards and perform the reimage without running pre‑operation validation checks.""" + + class BareMetalMachineReplaceSafeguardMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The safeguard mode to use for the replace action, where None indicates to bypass safeguards and All indicates to utilize all safeguards. @@ -373,6 +444,12 @@ class CloudServicesNetworkStorageStatusStatus(str, Enum, metaclass=CaseInsensiti """The storage allocation is expanding the volume.""" EXPANSION_FAILED = "ExpansionFailed" """The expansion of the storage allocation has failed.""" + INITIALIZING = "Initializing" + """The storage allocation is initializing.""" + NONE = "None" + """The storage allocation has no status.""" + REPAIRING = "Repairing" + """The storage allocation is being repaired.""" class ClusterConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -397,6 +474,21 @@ class ClusterContinueUpdateVersionMachineGroupTargetingMode( # pylint: disable= """Racks will be targeted for update in alphabetical order based on the rack name.""" +class ClusterContinueUpdateVersionSafeguardMode( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """ClusterContinueUpdateVersionSafeguardMode represents the mode of the cluster continue update + safeguards. + """ + + ALL = "All" + """Run all pre‑operation validation checks before continuing the version update. If any check + fails, the request is rejected and no changes are made.""" + NONE = "None" + """Skip all safeguards and continue the version update without running pre‑operation validation + checks.""" + + class ClusterDetailedStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current detailed status of the cluster.""" @@ -420,6 +512,15 @@ class ClusterDetailedStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The Failed status.""" +class ClusterInspectAdditionalAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Additional actions supplement the default non-disruptive cluster inspection. Additional actions + may be disallowed if the cluster is in a deployed and running state. + """ + + RESET_HARDWARE = "ResetHardware" + """Indicates that hardware reset should be performed during inspection.""" + + class ClusterManagerConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The latest connectivity status between cluster manager and the cluster.""" @@ -546,6 +647,17 @@ class ClusterUpdateStrategyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Pause after each rack is updated.""" +class ClusterUpdateVersionSafeguardMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ClusterUpdateVersionSafeguardMode represents the mode of the cluster update safeguards.""" + + ALL = "All" + """Run all pre‑operation validation checks before performing the version update. If any check + fails, the request is rejected and no changes are made.""" + NONE = "None" + """Skip all safeguards and perform the version update without running pre‑operation validation + checks.""" + + class CommandOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of command output for the override.""" @@ -555,6 +667,9 @@ class CommandOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """BareMetalMachineRunDataExtracts output type.""" BARE_METAL_MACHINE_RUN_READ_COMMANDS = "BareMetalMachineRunReadCommands" """BareMetalMachineRunReadCommands output type.""" + CLUSTER_SUPPORT_ADMINISTRATIVE_ACTIONS = "ClusterSupportAdministrativeActions" + """ClusterSupportAdministrativeActions output type supporting administrative actions that can be + run on a cluster for support purposes.""" STORAGE_RUN_READ_COMMANDS = "StorageRunReadCommands" """StorageRunReadCommands output type.""" BARE_METAL_MACHINE_RUN_DATA_EXTRACTS_RESTRICTED = "BareMetalMachineRunDataExtractsRestricted" @@ -627,6 +742,18 @@ class DefaultGateway(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This is not the default gateway.""" +class DeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type (kind) of the cluster. When specified, the value must exactly match the kind + configured on the cluster manager that manages the cluster. If omitted, the service will + default the value to the kind value of the cluster manager. + """ + + NEXUS = "Nexus" + """Azure Operator Nexus.""" + AZURE_LOCAL = "AzureLocal" + """Azure Local.""" + + class DeviceConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The connection type of the device.""" @@ -857,6 +984,19 @@ class KubernetesPluginType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """IPVLAN plugin type.""" +class KubernetesVersionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the Kubernetes version resource.""" + + ACCEPTED = "Accepted" + """The Accepted status.""" + CANCELED = "Canceled" + """The Canceled status.""" + FAILED = "Failed" + """The Failed status.""" + SUCCEEDED = "Succeeded" + """The Succeeded status.""" + + class L2NetworkDetailedStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The more detailed status of the L2 network.""" @@ -1034,6 +1174,15 @@ class RackSkuType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Combination of Aggregator Rack and Compute Rack for a single rack cluster.""" +class RelayPrivateEndpointConnectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The state to set for the private endpoint connection.""" + + APPROVED = "Approved" + """The private endpoint connection is approved.""" + REJECTED = "Rejected" + """The private endpoint connection is rejected.""" + + class RelayType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The indicator of which relay type the machine should be assigned to use. Platform indicates the use of a platform-dedicated relay. Public indicates the use of the standard public relay for @@ -1068,6 +1217,33 @@ class RemoteVendorManagementStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta) """Remote vendor management is unsupported.""" +class RuntimeProtectionAgentHealthStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The runtime protection agent health status.""" + + HEALTHY = "Healthy" + """The runtime protection agent is healthy.""" + UNHEALTHY = "Unhealthy" + """The runtime protection agent has health issues.""" + + +class RuntimeProtectionAgentLicenseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The runtime protection agent license status.""" + + LICENSED = "Licensed" + """The runtime protection agent license is valid.""" + UNLICENSED = "Unlicensed" + """The runtime protection agent license is not valid.""" + + +class RuntimeProtectionDefinitionUpdateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The definition update mode for runtime protection.""" + + AUTOMATIC = "Automatic" + """Update definitions automatically through the connected runtime protection agent.""" + NONE = "None" + """Do not update definitions.""" + + class RuntimeProtectionEnforcementLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The mode of operation for runtime protection.""" @@ -1083,6 +1259,15 @@ class RuntimeProtectionEnforcementLevel(str, Enum, metaclass=CaseInsensitiveEnum """Real-time scans detect and remediate detected issues.""" +class SecurityRuleDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The direction of allowed network traffic based on the rule.""" + + INBOUND = "Inbound" + """Inbound traffic toward the on-premsises cluster.""" + OUTBOUND = "Outbound" + """Outbound traffic from the on-premises cluster.""" + + class SkipShutdown(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. @@ -1120,6 +1305,28 @@ class StorageApplianceDetailedStatus(str, Enum, metaclass=CaseInsensitiveEnumMet """The Provisioning status.""" +class StorageApplianceMetricsConfigurationStatusLogLevel( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The log level for the monitoring configuration status of the storage appliance.""" + + DEFAULT = "Default" + """Logs are emitted at the default log level.""" + NEXUS = "Nexus" + """Logs are emitted at the Nexus log level.""" + + +class StorageApplianceMetricsConfigurationStatusMetricsLevel( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """The metrics level for the monitoring configuration status of the storage appliance.""" + + DEFAULT = "Default" + """Metrics are emitted at the default metrics level.""" + NEXUS = "Nexus" + """Metrics are emitted at the Nexus metrics level.""" + + class StorageApplianceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The provisioning state of the storage appliance.""" @@ -1135,6 +1342,15 @@ class StorageApplianceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnum """The Accepted status.""" +class TransportProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The protocol advertised by the access bridge endpoints.""" + + TCP = "TCP" + """The TCP transport protocol.""" + UDP = "UDP" + """The UDP transport protocol.""" + + class TrunkedNetworkDetailedStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The more detailed status of the trunked network.""" diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/_models.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/_models.py index 399060fd413b..8763823ec1fc 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/_models.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/models/_models.py @@ -47,6 +47,409 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class Resource(_Model): + """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.networkcloud.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked 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.networkcloud.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, 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 AccessBridge(TrackedResource): + """AccessBridge represents a managed access bridge 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.networkcloud.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 list of the resource properties. Required. + :vartype properties: ~azure.mgmt.networkcloud.models.AccessBridgeProperties + :ivar etag: "If etag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields."). + :vartype etag: str + :ivar extended_location: The extended location of the resource. This property is required when + creating the resource. Required. + :vartype extended_location: ~azure.mgmt.networkcloud.models.ExtendedLocation + """ + + properties: "_models.AccessBridgeProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The list of the resource properties. Required.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """\"If etag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\").""" + extended_location: "_models.ExtendedLocation" = rest_field(name="extendedLocation", visibility=["read", "create"]) + """The extended location of the resource. This property is required when creating the resource. + Required.""" + + __flattened_items = [ + "ipv4_connected_prefix", + "ipv6_connected_prefix", + "network_id", + "security_rules", + "detailed_status", + "detailed_status_message", + "endpoints", + "protocol", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.AccessBridgeProperties", + extended_location: "_models.ExtendedLocation", + tags: Optional[dict[str, 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: + _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 AccessBridgeEndpoint(_Model): + """AccessBridgeEndpoint describes a single advertised service endpoint. + + :ivar fqdn: The fully qualified domain name used to describe the certificate name for the + endpoint. + :vartype fqdn: str + :ivar ipv4_address: The IPv4 address associated with the endpoint. + :vartype ipv4_address: str + :ivar ipv6_address: The IPv6 address associated with the endpoint. + :vartype ipv6_address: str + :ivar name: The name that identifies the type of endpoint (for example VIP or host). + :vartype name: str + """ + + fqdn: Optional[str] = rest_field(visibility=["read"]) + """The fully qualified domain name used to describe the certificate name for the endpoint.""" + ipv4_address: Optional[str] = rest_field(name="ipv4Address", visibility=["read"]) + """The IPv4 address associated with the endpoint.""" + ipv6_address: Optional[str] = rest_field(name="ipv6Address", visibility=["read"]) + """The IPv6 address associated with the endpoint.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name that identifies the type of endpoint (for example VIP or host).""" + + +class AccessBridgePatchParameters(_Model): + """AccessBridgePatchParameters represents the payload for a PATCH request to an access bridge. + + :ivar properties: The list of the resource properties. + :vartype properties: ~azure.mgmt.networkcloud.models.AccessBridgePatchProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: Optional["_models.AccessBridgePatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The list of the resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.AccessBridgePatchProperties"] = None, + tags: Optional[dict[str, 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 AccessBridgePatchProperties(_Model): + """AccessBridgePatchProperties identifies the mutable properties for patch operations. + + :ivar security_rules: The list of security rules enforced by the access bridge. + :vartype security_rules: list[~azure.mgmt.networkcloud.models.AccessBridgeSecurityRule] + """ + + security_rules: Optional[list["_models.AccessBridgeSecurityRule"]] = rest_field( + name="securityRules", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of security rules enforced by the access bridge.""" + + @overload + def __init__( + self, + *, + security_rules: Optional[list["_models.AccessBridgeSecurityRule"]] = 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 AccessBridgeProperties(_Model): + """AccessBridgeProperties captures the input and status for an access bridge. + + :ivar ipv4_connected_prefix: The IPv4 subnet from which the access bridge allocates an address. + This subnet must be part of the internal network specified by networkId. + :vartype ipv4_connected_prefix: str + :ivar ipv6_connected_prefix: The IPv6 subnet from which the access bridge allocates an address. + This subnet must be part of the internal network specified by networkId. + :vartype ipv6_connected_prefix: str + :ivar network_id: The resource ID of the internal network in a layer 3 isolation domain + containing the IP subnets to use. Required. + :vartype network_id: str + :ivar security_rules: The list of security rules enforced by the access bridge. + :vartype security_rules: list[~azure.mgmt.networkcloud.models.AccessBridgeSecurityRule] + :ivar detailed_status: The detailed status reported by the access bridge. Known values are: + "Running", "Degraded", and "Failed". + :vartype detailed_status: str or ~azure.mgmt.networkcloud.models.AccessBridgeDetailedStatus + :ivar detailed_status_message: The descriptive message that accompanies the detailed status. + :vartype detailed_status_message: str + :ivar endpoints: The observed endpoints that clients should use to reach the access bridge. + :vartype endpoints: list[~azure.mgmt.networkcloud.models.AccessBridgeEndpoint] + :ivar protocol: The protocol advertised by the access bridge endpoints. Known values are: "TCP" + and "UDP". + :vartype protocol: str or ~azure.mgmt.networkcloud.models.TransportProtocol + :ivar provisioning_state: The provisioning state of the access bridge. Known values are: + "Accepted", "Canceled", "Failed", "Provisioning", and "Succeeded". + :vartype provisioning_state: str or + ~azure.mgmt.networkcloud.models.AccessBridgeProvisioningState + """ + + ipv4_connected_prefix: Optional[str] = rest_field(name="ipv4ConnectedPrefix", visibility=["read", "create"]) + """The IPv4 subnet from which the access bridge allocates an address. This subnet must be part of + the internal network specified by networkId.""" + ipv6_connected_prefix: Optional[str] = rest_field(name="ipv6ConnectedPrefix", visibility=["read", "create"]) + """The IPv6 subnet from which the access bridge allocates an address. This subnet must be part of + the internal network specified by networkId.""" + network_id: str = rest_field(name="networkId", visibility=["read", "create"]) + """The resource ID of the internal network in a layer 3 isolation domain containing the IP subnets + to use. Required.""" + security_rules: Optional[list["_models.AccessBridgeSecurityRule"]] = rest_field( + name="securityRules", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of security rules enforced by the access bridge.""" + detailed_status: Optional[Union[str, "_models.AccessBridgeDetailedStatus"]] = rest_field( + name="detailedStatus", visibility=["read"] + ) + """The detailed status reported by the access bridge. Known values are: \"Running\", \"Degraded\", + and \"Failed\".""" + detailed_status_message: Optional[str] = rest_field(name="detailedStatusMessage", visibility=["read"]) + """The descriptive message that accompanies the detailed status.""" + endpoints: Optional[list["_models.AccessBridgeEndpoint"]] = rest_field(visibility=["read"]) + """The observed endpoints that clients should use to reach the access bridge.""" + protocol: Optional[Union[str, "_models.TransportProtocol"]] = rest_field(visibility=["read"]) + """The protocol advertised by the access bridge endpoints. Known values are: \"TCP\" and \"UDP\".""" + provisioning_state: Optional[Union[str, "_models.AccessBridgeProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the access bridge. Known values are: \"Accepted\", \"Canceled\", + \"Failed\", \"Provisioning\", and \"Succeeded\".""" + + @overload + def __init__( + self, + *, + network_id: str, + ipv4_connected_prefix: Optional[str] = None, + ipv6_connected_prefix: Optional[str] = None, + security_rules: Optional[list["_models.AccessBridgeSecurityRule"]] = 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 AccessBridgeSecurityRule(_Model): + """AccessBridgeSecurityRule captures an individual access rule enforced by the bridge. + + :ivar description: The user provided value describing this rule. + :vartype description: str + :ivar direction: The direction of allowed network traffic based on the rule. Required. Known + values are: "Inbound" and "Outbound". + :vartype direction: str or ~azure.mgmt.networkcloud.models.SecurityRuleDirection + :ivar ipv4_addresses: The set of IPv4 addresses permitted as the source or destination of the + security rule. For as single address, utilize a /32 (CIDR notation). One or both Ipv4Addresses + and Ipv6Addresses must be specified. Example formats: 10.10.10.10-10.10.10.20 or + 10.10.10.10/24. + :vartype ipv4_addresses: list[str] + :ivar ipv6_addresses: The set of IPv6 addresses permitted as the source or destination of the + security rule. For as single address, utilize a /128 (CIDR notation). One or both Ipv4Addresses + and Ipv6Addresses must be specified. Example formats: 2001:db8:abcd::1-2001:db8:abcd::ff or + 2001:db8:abcd::1/64. + :vartype ipv6_addresses: list[str] + :ivar port: The source or destination port or port range. Example 24562 or 24562-24570. + Required. + :vartype port: str + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The user provided value describing this rule.""" + direction: Union[str, "_models.SecurityRuleDirection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The direction of allowed network traffic based on the rule. Required. Known values are: + \"Inbound\" and \"Outbound\".""" + ipv4_addresses: Optional[list[str]] = rest_field( + name="ipv4Addresses", visibility=["read", "create", "update", "delete", "query"] + ) + """The set of IPv4 addresses permitted as the source or destination of the security rule. For as + single address, utilize a /32 (CIDR notation). One or both Ipv4Addresses and Ipv6Addresses must + be specified. Example formats: 10.10.10.10-10.10.10.20 or 10.10.10.10/24.""" + ipv6_addresses: Optional[list[str]] = rest_field( + name="ipv6Addresses", visibility=["read", "create", "update", "delete", "query"] + ) + """The set of IPv6 addresses permitted as the source or destination of the security rule. For as + single address, utilize a /128 (CIDR notation). One or both Ipv4Addresses and Ipv6Addresses + must be specified. Example formats: 2001:db8:abcd::1-2001:db8:abcd::ff or 2001:db8:abcd::1/64.""" + port: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source or destination port or port range. Example 24562 or 24562-24570. Required.""" + + @overload + def __init__( + self, + *, + direction: Union[str, "_models.SecurityRuleDirection"], + port: str, + description: Optional[str] = None, + ipv4_addresses: Optional[list[str]] = None, + ipv6_addresses: 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 ActionState(_Model): """ActionState represents the state of an action taken against a resource. This can be used to represent both explicitly and implicitly defined action types. @@ -235,78 +638,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Resource(_Model): - """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.networkcloud.models.SystemData - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the resource.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or - \"Microsoft.Storage/storageAccounts\".""" - system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) - """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" - - -class TrackedResource(Resource): - """Tracked 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.networkcloud.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Resource tags.""" - location: str = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives. Required.""" - - @overload - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, 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 AgentPool(TrackedResource): """AgentPool represents the agent pool of Kubernetes cluster. @@ -845,6 +1176,8 @@ class BareMetalMachine(TrackedResource): "serial_number", "action_states", "associated_resource_ids", + "bmc_ipv4_address", + "bmc_ipv6_address", "ca_certificate", "cluster_id", "cordon_status", @@ -857,6 +1190,7 @@ class BareMetalMachine(TrackedResource): "kubernetes_version", "machine_cluster_version", "machine_roles", + "monitoring_configuration_status", "oam_ipv4_address", "oam_ipv6_address", "os_image", @@ -1374,6 +1708,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class BareMetalMachineMonitoringConfigurationStatus(_Model): # pylint: disable=name-too-long + """BareMetalMachineMonitoringConfigurationStatus represents the monitoring configuration status of + the bare metal machine. + + :ivar log_level: The log level for the monitoring configuration status of the bare metal + machine. Known values are: "Default" and "Nexus". + :vartype log_level: str or + ~azure.mgmt.networkcloud.models.BareMetalMachineMetricsConfigurationStatusLogLevel + :ivar metrics_level: The metrics level for the monitoring configuration status of the bare + metal machine. Known values are: "Default" and "Nexus". + :vartype metrics_level: str or + ~azure.mgmt.networkcloud.models.BareMetalMachineMetricsConfigurationStatusMetricsLevel + """ + + log_level: Optional[Union[str, "_models.BareMetalMachineMetricsConfigurationStatusLogLevel"]] = rest_field( + name="logLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """The log level for the monitoring configuration status of the bare metal machine. Known values + are: \"Default\" and \"Nexus\".""" + metrics_level: Optional[Union[str, "_models.BareMetalMachineMetricsConfigurationStatusMetricsLevel"]] = rest_field( + name="metricsLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """The metrics level for the monitoring configuration status of the bare metal machine. Known + values are: \"Default\" and \"Nexus\".""" + + @overload + def __init__( + self, + *, + log_level: Optional[Union[str, "_models.BareMetalMachineMetricsConfigurationStatusLogLevel"]] = None, + metrics_level: Optional[Union[str, "_models.BareMetalMachineMetricsConfigurationStatusMetricsLevel"]] = 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 BareMetalMachinePatchParameters(_Model): """BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. @@ -1528,6 +1906,10 @@ class BareMetalMachineProperties(_Model): :ivar associated_resource_ids: The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. :vartype associated_resource_ids: list[str] + :ivar bmc_ipv4_address: The IPv4 address of the BMC interface for the bare metal machine. + :vartype bmc_ipv4_address: str + :ivar bmc_ipv6_address: The IPv6 address of the BMC interface for the bare metal machine. + :vartype bmc_ipv6_address: str :ivar ca_certificate: The CA certificate information issued by the platform for connecting to TLS interfaces for the bare metal machine. Callers add this certificate to the trusted CA store on the Kubernetes control plane nodes to allow secure communication with the bare metal @@ -1564,6 +1946,10 @@ class BareMetalMachineProperties(_Model): :ivar machine_roles: The list of roles that are assigned to the cluster node running on this machine. :vartype machine_roles: list[str] + :ivar monitoring_configuration_status: The monitoring configuration status of the bare metal + machine. + :vartype monitoring_configuration_status: + ~azure.mgmt.networkcloud.models.BareMetalMachineMonitoringConfigurationStatus :ivar oam_ipv4_address: The IPv4 address that is assigned to the bare metal machine during the cluster deployment. :vartype oam_ipv4_address: str @@ -1628,6 +2014,10 @@ class BareMetalMachineProperties(_Model): associated_resource_ids: Optional[list[str]] = rest_field(name="associatedResourceIds", visibility=["read"]) """The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.""" + bmc_ipv4_address: Optional[str] = rest_field(name="bmcIpv4Address", visibility=["read"]) + """The IPv4 address of the BMC interface for the bare metal machine.""" + bmc_ipv6_address: Optional[str] = rest_field(name="bmcIpv6Address", visibility=["read"]) + """The IPv6 address of the BMC interface for the bare metal machine.""" ca_certificate: Optional["_models.CertificateInfo"] = rest_field(name="caCertificate", visibility=["read"]) """The CA certificate information issued by the platform for connecting to TLS interfaces for the bare metal machine. Callers add this certificate to the trusted CA store on the Kubernetes @@ -1671,6 +2061,10 @@ class BareMetalMachineProperties(_Model): update.""" machine_roles: Optional[list[str]] = rest_field(name="machineRoles", visibility=["read"]) """The list of roles that are assigned to the cluster node running on this machine.""" + monitoring_configuration_status: Optional["_models.BareMetalMachineMonitoringConfigurationStatus"] = rest_field( + name="monitoringConfigurationStatus", visibility=["read"] + ) + """The monitoring configuration status of the bare metal machine.""" oam_ipv4_address: Optional[str] = rest_field(name="oamIpv4Address", visibility=["read"]) """The IPv4 address that is assigned to the bare metal machine during the cluster deployment.""" oam_ipv6_address: Optional[str] = rest_field(name="oamIpv6Address", visibility=["read"]) @@ -1736,6 +2130,42 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class BareMetalMachineReimageParameters(_Model): + """BareMetalMachineReimageParameters represents the body of the request to reimage a bare metal + machine. + + :ivar safeguard_mode: The safeguard mode to use for the reimage action, where None indicates to + bypass safeguards and All indicates to utilize all safeguards. If not specified, the default is + All. Known values are: "All" and "None". + :vartype safeguard_mode: str or + ~azure.mgmt.networkcloud.models.BareMetalMachineReimageSafeguardMode + """ + + safeguard_mode: Optional[Union[str, "_models.BareMetalMachineReimageSafeguardMode"]] = rest_field( + name="safeguardMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The safeguard mode to use for the reimage action, where None indicates to bypass safeguards and + All indicates to utilize all safeguards. If not specified, the default is All. Known values + are: \"All\" and \"None\".""" + + @overload + def __init__( + self, + *, + safeguard_mode: Optional[Union[str, "_models.BareMetalMachineReimageSafeguardMode"]] = 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 BareMetalMachineReplaceParameters(_Model): """BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. @@ -2792,7 +3222,8 @@ class CloudServicesNetworkStorageStatus(_Model): :ivar size_mi_b: The size in Mebibytes of the storage allocation. :vartype size_mi_b: int :ivar status: The status of the storage allocation for the cloud services network. Known values - are: "Available", "ExpandingVolume", and "ExpansionFailed". + are: "Available", "ExpandingVolume", "ExpansionFailed", "Initializing", "None", and + "Repairing". :vartype status: str or ~azure.mgmt.networkcloud.models.CloudServicesNetworkStorageStatusStatus :ivar status_message: The description for the status of the shared storage. :vartype status_message: str @@ -2807,7 +3238,8 @@ class CloudServicesNetworkStorageStatus(_Model): """The size in Mebibytes of the storage allocation.""" status: Optional[Union[str, "_models.CloudServicesNetworkStorageStatusStatus"]] = rest_field(visibility=["read"]) """The status of the storage allocation for the cloud services network. Known values are: - \"Available\", \"ExpandingVolume\", and \"ExpansionFailed\".""" + \"Available\", \"ExpandingVolume\", \"ExpansionFailed\", \"Initializing\", \"None\", and + \"Repairing\".""" status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"]) """The description for the status of the shared storage.""" volume_id: Optional[str] = rest_field(name="volumeId", visibility=["read"]) @@ -2844,6 +3276,11 @@ class Cluster(TrackedResource): :vartype extended_location: ~azure.mgmt.networkcloud.models.ExtendedLocation :ivar identity: The managed service identities assigned to this resource. :vartype identity: ~azure.mgmt.networkcloud.models.ManagedServiceIdentity + :ivar kind: The type (kind) of the cluster. When specified, the value must exactly match the + kind configured on the cluster manager that manages the cluster. If omitted, the service will + default the value to the kind value of the cluster manager. Known values are: "Nexus" and + "AzureLocal". + :vartype kind: str or ~azure.mgmt.networkcloud.models.DeploymentType """ properties: "_models.ClusterProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -2860,6 +3297,11 @@ class Cluster(TrackedResource): visibility=["read", "create", "update", "delete", "query"] ) """The managed service identities assigned to this resource.""" + kind: Optional[Union[str, "_models.DeploymentType"]] = rest_field(visibility=["read", "create"]) + """The type (kind) of the cluster. When specified, the value must exactly match the kind + configured on the cluster manager that manages the cluster. If omitted, the service will + default the value to the kind value of the cluster manager. Known values are: \"Nexus\" and + \"AzureLocal\".""" __flattened_items = [ "aggregator_or_single_rack_definition", @@ -2889,6 +3331,8 @@ class Cluster(TrackedResource): "detailed_status", "detailed_status_message", "hybrid_aks_extended_location", + "last_successful_version_update_time", + "managed_credentials", "manual_action_count", "support_expiry_date", "workload_resource_ids", @@ -2904,6 +3348,7 @@ def __init__( extended_location: "_models.ExtendedLocation", tags: Optional[dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, + kind: Optional[Union[str, "_models.DeploymentType"]] = None, ) -> None: ... @overload @@ -3090,6 +3535,11 @@ class ClusterContinueUpdateVersionParameters(_Model): of servers to continue the update. "AlphaByRack" :vartype machine_group_targeting_mode: str or ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionMachineGroupTargetingMode + :ivar safeguard_mode: Specifies how safeguards are applied during the continue update version + operation. Use All to run all pre‑operation validation checks. Use None to bypass safeguards. + If not specified, the default is All. Known values are: "All" and "None". + :vartype safeguard_mode: str or + ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionSafeguardMode """ machine_group_targeting_mode: Optional[ @@ -3097,6 +3547,12 @@ class ClusterContinueUpdateVersionParameters(_Model): ] = rest_field(name="machineGroupTargetingMode", visibility=["read", "create", "update", "delete", "query"]) """The mode by which the cluster will target the next grouping of servers to continue the update. \"AlphaByRack\"""" + safeguard_mode: Optional[Union[str, "_models.ClusterContinueUpdateVersionSafeguardMode"]] = rest_field( + name="safeguardMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies how safeguards are applied during the continue update version operation. Use All to + run all pre‑operation validation checks. Use None to bypass safeguards. If not specified, the + default is All. Known values are: \"All\" and \"None\".""" @overload def __init__( @@ -3105,6 +3561,7 @@ def __init__( machine_group_targeting_mode: Optional[ Union[str, "_models.ClusterContinueUpdateVersionMachineGroupTargetingMode"] ] = None, + safeguard_mode: Optional[Union[str, "_models.ClusterContinueUpdateVersionSafeguardMode"]] = None, ) -> None: ... @overload @@ -3150,6 +3607,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ClusterInspectParameters(_Model): + """ClusterInspectParameters represents the body of the request to inspect the cluster. + + :ivar additional_actions: Additional actions supplement the default non-disruptive cluster + inspection. Additional actions may be disallowed if the cluster is in a deployed and running + state. + :vartype additional_actions: list[str or + ~azure.mgmt.networkcloud.models.ClusterInspectAdditionalAction] + :ivar filter_devices: Indicates which devices are included in the inspection. By default, all + devices that can be targeted will be included in the inspection. + :vartype filter_devices: ~azure.mgmt.networkcloud.models.FilterDevices + """ + + additional_actions: Optional[list[Union[str, "_models.ClusterInspectAdditionalAction"]]] = rest_field( + name="additionalActions", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional actions supplement the default non-disruptive cluster inspection. Additional actions + may be disallowed if the cluster is in a deployed and running state.""" + filter_devices: Optional["_models.FilterDevices"] = rest_field( + name="filterDevices", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates which devices are included in the inspection. By default, all devices that can be + targeted will be included in the inspection.""" + + @overload + def __init__( + self, + *, + additional_actions: Optional[list[Union[str, "_models.ClusterInspectAdditionalAction"]]] = None, + filter_devices: Optional["_models.FilterDevices"] = 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 ClusterManager(TrackedResource): """ClusterManager represents a control-plane to manage one or more on-premises clusters. @@ -3177,6 +3677,8 @@ class ClusterManager(TrackedResource): :vartype etag: str :ivar identity: The managed service identities assigned to this resource. :vartype identity: ~azure.mgmt.networkcloud.models.ManagedServiceIdentity + :ivar kind: The kind of the cluster manager. Known values are: "Nexus" and "AzureLocal". + :vartype kind: str or ~azure.mgmt.networkcloud.models.DeploymentType """ properties: "_models.ClusterManagerProperties" = rest_field( @@ -3192,6 +3694,8 @@ class ClusterManager(TrackedResource): visibility=["read", "create", "update", "delete", "query"] ) """The managed service identities assigned to this resource.""" + kind: Optional[Union[str, "_models.DeploymentType"]] = rest_field(visibility=["read", "create"]) + """The kind of the cluster manager. Known values are: \"Nexus\" and \"AzureLocal\".""" __flattened_items = [ "analytics_workspace_id", @@ -3203,6 +3707,7 @@ class ClusterManager(TrackedResource): "managed_resource_group_configuration", "manager_extended_location", "provisioning_state", + "relay_configuration", "vm_size", ] @@ -3214,6 +3719,7 @@ def __init__( properties: "_models.ClusterManagerProperties", tags: Optional[dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, + kind: Optional[Union[str, "_models.DeploymentType"]] = None, ) -> None: ... @overload @@ -3314,6 +3820,8 @@ class ClusterManagerProperties(_Model): "Succeeded", "Failed", "Canceled", "Provisioning", "Accepted", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.networkcloud.models.ClusterManagerProvisioningState + :ivar relay_configuration: The relay configuration for the cluster manager. + :vartype relay_configuration: ~azure.mgmt.networkcloud.models.ClusterManagerRelayConfiguration :ivar vm_size: The size of the Azure virtual machines to use for hosting the cluster manager resource. :vartype vm_size: str @@ -3354,6 +3862,10 @@ class ClusterManagerProperties(_Model): ) """The provisioning state of the cluster manager. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Provisioning\", \"Accepted\", and \"Updating\".""" + relay_configuration: Optional["_models.ClusterManagerRelayConfiguration"] = rest_field( + name="relayConfiguration", visibility=["read"] + ) + """The relay configuration for the cluster manager.""" vm_size: Optional[str] = rest_field(name="vmSize", visibility=["read", "create"]) """The size of the Azure virtual machines to use for hosting the cluster manager resource.""" @@ -3379,6 +3891,86 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ClusterManagerRelayConfiguration(_Model): + """ClusterManagerRelayConfiguration represents the relay configuration for the cluster manager. + + :ivar relay_namespace_id: The resource ID of the Azure relay namespace managed by the cluster + manager. + :vartype relay_namespace_id: str + """ + + relay_namespace_id: Optional[str] = rest_field( + name="relayNamespaceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the Azure relay namespace managed by the cluster manager.""" + + @overload + def __init__( + self, + *, + relay_namespace_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 ClusterManagerUpdateRelayPrivateEndpointConnectionParameters(_Model): # pylint: disable=name-too-long + """ClusterManagerUpdateRelayPrivateEndpointConnectionParameters represents the body of the request + to approve or reject the relay private endpoint connection for the private relay managed by a + cluster manager. + + :ivar connection_state: The state to set for the private endpoint connection. Required. Known + values are: "Approved" and "Rejected". + :vartype connection_state: str or + ~azure.mgmt.networkcloud.models.RelayPrivateEndpointConnectionState + :ivar description: The description to associate with the private endpoint connection. + :vartype description: str + :ivar private_endpoint_resource_id: The resource ID of private endpoint to be permitted or + denied connection to the relay namespace. Required. + :vartype private_endpoint_resource_id: str + """ + + connection_state: Union[str, "_models.RelayPrivateEndpointConnectionState"] = rest_field( + name="connectionState", visibility=["read", "create", "update", "delete", "query"] + ) + """The state to set for the private endpoint connection. Required. Known values are: \"Approved\" + and \"Rejected\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description to associate with the private endpoint connection.""" + private_endpoint_resource_id: str = rest_field( + name="privateEndpointResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of private endpoint to be permitted or denied connection to the relay + namespace. Required.""" + + @overload + def __init__( + self, + *, + connection_state: Union[str, "_models.RelayPrivateEndpointConnectionState"], + private_endpoint_resource_id: str, + description: 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 ClusterMetricsConfiguration(TrackedResource): """ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. @@ -3924,6 +4516,12 @@ class ClusterProperties(_Model): control plane location. This extended location is used when creating provisioned clusters (Hybrid AKS clusters). :vartype hybrid_aks_extended_location: ~azure.mgmt.networkcloud.models.ExtendedLocation + :ivar last_successful_version_update_time: The date and time of the end of the last successful + version update for the cluster. + :vartype last_successful_version_update_time: ~datetime.datetime + :ivar managed_credentials: The list of credentials that are managed for the cluster and can be + rotated on-demand. + :vartype managed_credentials: list[str] :ivar manual_action_count: The count of Manual Action Taken (MAT) events that have not been validated. :vartype manual_action_count: int @@ -4048,6 +4646,12 @@ class ClusterProperties(_Model): """Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom location) that represents the Hybrid AKS control plane location. This extended location is used when creating provisioned clusters (Hybrid AKS clusters).""" + last_successful_version_update_time: Optional[datetime.datetime] = rest_field( + name="lastSuccessfulVersionUpdateTime", visibility=["read"], format="rfc3339" + ) + """The date and time of the end of the last successful version update for the cluster.""" + managed_credentials: Optional[list[str]] = rest_field(name="managedCredentials", visibility=["read"]) + """The list of credentials that are managed for the cluster and can be rotated on-demand.""" manual_action_count: Optional[int] = rest_field(name="manualActionCount", visibility=["read"]) """The count of Manual Action Taken (MAT) events that have not been validated.""" support_expiry_date: Optional[str] = rest_field(name="supportExpiryDate", visibility=["read"]) @@ -4061,26 +4665,55 @@ class ClusterProperties(_Model): \"Canceled\", \"Accepted\", \"Validating\", and \"Updating\".""" @overload - def __init__( # pylint: disable=too-many-locals + def __init__( # pylint: disable=too-many-locals + self, + *, + aggregator_or_single_rack_definition: "_models.RackDefinition", + cluster_type: Union[str, "_models.ClusterType"], + cluster_version: str, + network_fabric_id: str, + analytics_output_settings: Optional["_models.AnalyticsOutputSettings"] = None, + analytics_workspace_id: Optional[str] = None, + cluster_location: Optional[str] = None, + cluster_service_principal: Optional["_models.ServicePrincipalInformation"] = None, + command_output_settings: Optional["_models.CommandOutputSettings"] = None, + compute_deployment_threshold: Optional["_models.ValidationThreshold"] = None, + compute_rack_definitions: Optional[list["_models.RackDefinition"]] = None, + managed_resource_group_configuration: Optional["_models.ManagedResourceGroupConfiguration"] = None, + runtime_protection_configuration: Optional["_models.RuntimeProtectionConfiguration"] = None, + secret_archive: Optional["_models.ClusterSecretArchive"] = None, + secret_archive_settings: Optional["_models.SecretArchiveSettings"] = None, + update_strategy: Optional["_models.ClusterUpdateStrategy"] = None, + vulnerability_scanning_settings: Optional["_models.VulnerabilityScanningSettings"] = 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 ClusterRotateCredentialParameters(_Model): + """ClusterRotateCredentialParameters represents the body of the request to rotate cluster + credentials. + + :ivar credentials: The list of credential names for the credentials to rotate. Required. + :vartype credentials: list[str] + """ + + credentials: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The list of credential names for the credentials to rotate. Required.""" + + @overload + def __init__( self, *, - aggregator_or_single_rack_definition: "_models.RackDefinition", - cluster_type: Union[str, "_models.ClusterType"], - cluster_version: str, - network_fabric_id: str, - analytics_output_settings: Optional["_models.AnalyticsOutputSettings"] = None, - analytics_workspace_id: Optional[str] = None, - cluster_location: Optional[str] = None, - cluster_service_principal: Optional["_models.ServicePrincipalInformation"] = None, - command_output_settings: Optional["_models.CommandOutputSettings"] = None, - compute_deployment_threshold: Optional["_models.ValidationThreshold"] = None, - compute_rack_definitions: Optional[list["_models.RackDefinition"]] = None, - managed_resource_group_configuration: Optional["_models.ManagedResourceGroupConfiguration"] = None, - runtime_protection_configuration: Optional["_models.RuntimeProtectionConfiguration"] = None, - secret_archive: Optional["_models.ClusterSecretArchive"] = None, - secret_archive_settings: Optional["_models.SecretArchiveSettings"] = None, - update_strategy: Optional["_models.ClusterUpdateStrategy"] = None, - vulnerability_scanning_settings: Optional["_models.VulnerabilityScanningSettings"] = None, + credentials: list[str], ) -> None: ... @overload @@ -4234,10 +4867,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ClusterUpdateVersionParameters(_Model): """ClusterUpdateVersionParameters represents the body of the request to update cluster version. + :ivar safeguard_mode: Specifies how safeguards are applied during the update version operation. + Use All to run all pre‑operation validation checks. Use None to bypass safeguards. If not + specified, the default is All. Known values are: "All" and "None". + :vartype safeguard_mode: str or + ~azure.mgmt.networkcloud.models.ClusterUpdateVersionSafeguardMode :ivar target_cluster_version: The version to be applied to the cluster during update. Required. :vartype target_cluster_version: str """ + safeguard_mode: Optional[Union[str, "_models.ClusterUpdateVersionSafeguardMode"]] = rest_field( + name="safeguardMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies how safeguards are applied during the update version operation. Use All to run all + pre‑operation validation checks. Use None to bypass safeguards. If not specified, the default + is All. Known values are: \"All\" and \"None\".""" target_cluster_version: str = rest_field( name="targetClusterVersion", visibility=["read", "create", "update", "delete", "query"] ) @@ -4248,6 +4892,7 @@ def __init__( self, *, target_cluster_version: str, + safeguard_mode: Optional[Union[str, "_models.ClusterUpdateVersionSafeguardMode"]] = None, ) -> None: ... @overload @@ -4269,8 +4914,8 @@ class CommandOutputOverride(_Model): :vartype associated_identity: ~azure.mgmt.networkcloud.models.IdentitySelector :ivar command_output_type: The type of command output for the override. Known values are: "BareMetalMachineRunCommand", "BareMetalMachineRunDataExtracts", - "BareMetalMachineRunReadCommands", "StorageRunReadCommands", and - "BareMetalMachineRunDataExtractsRestricted". + "BareMetalMachineRunReadCommands", "ClusterSupportAdministrativeActions", + "StorageRunReadCommands", and "BareMetalMachineRunDataExtractsRestricted". :vartype command_output_type: str or ~azure.mgmt.networkcloud.models.CommandOutputType :ivar container_url: The URL of the storage account container that is to be used by the specified identities. @@ -4287,7 +4932,8 @@ class CommandOutputOverride(_Model): ) """The type of command output for the override. Known values are: \"BareMetalMachineRunCommand\", \"BareMetalMachineRunDataExtracts\", \"BareMetalMachineRunReadCommands\", - \"StorageRunReadCommands\", and \"BareMetalMachineRunDataExtractsRestricted\".""" + \"ClusterSupportAdministrativeActions\", \"StorageRunReadCommands\", and + \"BareMetalMachineRunDataExtractsRestricted\".""" container_url: Optional[str] = rest_field( name="containerUrl", visibility=["read", "create", "update", "delete", "query"] ) @@ -4936,6 +5582,44 @@ class FeatureStatus(_Model): """The version of the feature.""" +class FilterDevices(_Model): + """FilterDevices defines the filtered target of the inspection. + + :ivar bare_metal_machine_names: The list of bare metal machine names to include in the + inspection. + :vartype bare_metal_machine_names: list[str] + :ivar rack_names: The list of rack names to include in the inspection. + :vartype rack_names: list[str] + """ + + bare_metal_machine_names: Optional[list[str]] = rest_field( + name="bareMetalMachineNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of bare metal machine names to include in the inspection.""" + rack_names: Optional[list[str]] = rest_field( + name="rackNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of rack names to include in the inspection.""" + + @overload + def __init__( + self, + *, + bare_metal_machine_names: Optional[list[str]] = None, + rack_names: 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 HardwareInventory(_Model): """HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information acquired from the model/sku information and from the ironic @@ -6088,6 +6772,156 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class KubernetesVersion(TrackedResource): + """KubernetesVersion represents the available Kubernetes versions for a 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.networkcloud.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 list of the resource properties. Required. + :vartype properties: ~azure.mgmt.networkcloud.models.KubernetesVersionProperties + :ivar etag: "If etag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields."). + :vartype etag: str + :ivar extended_location: The extended location of the resource. This property is required when + creating the resource. Required. + :vartype extended_location: ~azure.mgmt.networkcloud.models.ExtendedLocation + """ + + properties: "_models.KubernetesVersionProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The list of the resource properties. Required.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """\"If etag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.\").""" + extended_location: "_models.ExtendedLocation" = rest_field(name="extendedLocation", visibility=["read", "create"]) + """The extended location of the resource. This property is required when creating the resource. + Required.""" + + __flattened_items = ["values_property", "provisioning_state"] + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.KubernetesVersionProperties", + extended_location: "_models.ExtendedLocation", + tags: Optional[dict[str, 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: + _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 KubernetesVersionPatchParameters(_Model): + """KubernetesVersionPatchParameters represents the body of the request to patch Kubernetes version + tags. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, 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 KubernetesVersionProperties(_Model): + """KubernetesVersionProperties contains the read-only properties describing available versions. + + :ivar values_property: The list of available Kubernetes versions. + :vartype values_property: list[~azure.mgmt.networkcloud.models.KubernetesVersionValue] + :ivar provisioning_state: The provisioning state of the Kubernetes version resource. Known + values are: "Accepted", "Canceled", "Failed", and "Succeeded". + :vartype provisioning_state: str or + ~azure.mgmt.networkcloud.models.KubernetesVersionProvisioningState + """ + + values_property: Optional[list["_models.KubernetesVersionValue"]] = rest_field( + name="values", visibility=["read"], original_tsp_name="values" + ) + """The list of available Kubernetes versions.""" + provisioning_state: Optional[Union[str, "_models.KubernetesVersionProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the Kubernetes version resource. Known values are: \"Accepted\", + \"Canceled\", \"Failed\", and \"Succeeded\".""" + + +class KubernetesVersionValue(_Model): + """KubernetesVersionValue describes a specific Kubernetes version that can be deployed. + + :ivar description: Additional description for the Kubernetes version. + :vartype description: str + :ivar version: The Kubernetes version identifier. + :vartype version: str + """ + + description: Optional[str] = rest_field(visibility=["read"]) + """Additional description for the Kubernetes version.""" + version: Optional[str] = rest_field(visibility=["read"]) + """The Kubernetes version identifier.""" + + class L2Network(TrackedResource): """L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. @@ -7826,6 +8660,7 @@ class RackSku(ProxyResource): __flattened_items = [ "compute_machines", "controller_machines", + "deployment_type", "description", "max_cluster_slots", "provisioning_state", @@ -7880,6 +8715,9 @@ class RackSkuProperties(_Model): :ivar controller_machines: The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. :vartype controller_machines: list[~azure.mgmt.networkcloud.models.MachineSkuSlot] + :ivar deployment_type: The deployment type supported by the rack SKU. Known values are: "Nexus" + and "AzureLocal". + :vartype deployment_type: str or ~azure.mgmt.networkcloud.models.DeploymentType :ivar description: The free-form text describing the rack. :vartype description: str :ivar max_cluster_slots: The maximum number of compute racks supported by an aggregator rack. 0 @@ -7905,6 +8743,10 @@ class RackSkuProperties(_Model): ) """The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model.""" + deployment_type: Optional[Union[str, "_models.DeploymentType"]] = rest_field( + name="deploymentType", visibility=["read"] + ) + """The deployment type supported by the rack SKU. Known values are: \"Nexus\" and \"AzureLocal\".""" description: Optional[str] = rest_field(visibility=["read"]) """The free-form text describing the rack.""" max_cluster_slots: Optional[int] = rest_field(name="maxClusterSlots", visibility=["read"]) @@ -7968,12 +8810,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RuntimeProtectionConfiguration(_Model): """RuntimeProtectionConfiguration represents the runtime protection configuration for the cluster. + :ivar definition_update_mode: The definition update mode for runtime protection. Known values + are: "Automatic" and "None". + :vartype definition_update_mode: str or + ~azure.mgmt.networkcloud.models.RuntimeProtectionDefinitionUpdateMode :ivar enforcement_level: The mode of operation for runtime protection. Known values are: "Audit", "Disabled", "OnDemand", "Passive", and "RealTime". :vartype enforcement_level: str or ~azure.mgmt.networkcloud.models.RuntimeProtectionEnforcementLevel """ + definition_update_mode: Optional[Union[str, "_models.RuntimeProtectionDefinitionUpdateMode"]] = rest_field( + name="definitionUpdateMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The definition update mode for runtime protection. Known values are: \"Automatic\" and + \"None\".""" enforcement_level: Optional[Union[str, "_models.RuntimeProtectionEnforcementLevel"]] = rest_field( name="enforcementLevel", visibility=["read", "create", "update", "delete", "query"] ) @@ -7984,6 +8835,7 @@ class RuntimeProtectionConfiguration(_Model): def __init__( self, *, + definition_update_mode: Optional[Union[str, "_models.RuntimeProtectionDefinitionUpdateMode"]] = None, enforcement_level: Optional[Union[str, "_models.RuntimeProtectionEnforcementLevel"]] = None, ) -> None: ... @@ -8001,10 +8853,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RuntimeProtectionStatus(_Model): """RuntimeProtectionStatus represents the runtime protection status of the bare metal machine. + :ivar agent_health_status: The runtime protection agent health status. Known values are: + "Healthy" and "Unhealthy". + :vartype agent_health_status: str or + ~azure.mgmt.networkcloud.models.RuntimeProtectionAgentHealthStatus + :ivar agent_health_status_issues: The runtime protection agent health status issues, if + present. + :vartype agent_health_status_issues: list[str] + :ivar agent_license_status: The runtime protection agent license status. Known values are: + "Licensed" and "Unlicensed". + :vartype agent_license_status: str or + ~azure.mgmt.networkcloud.models.RuntimeProtectionAgentLicenseStatus + :ivar definition_update_mode: The definition update mode for runtime protection. Known values + are: "Automatic" and "None". + :vartype definition_update_mode: str or + ~azure.mgmt.networkcloud.models.RuntimeProtectionDefinitionUpdateMode :ivar definitions_last_updated: The timestamp when the malware definitions were last updated. :vartype definitions_last_updated: ~datetime.datetime :ivar definitions_version: The version of the malware definitions. :vartype definitions_version: str + :ivar enforcement_level: The enforcement level set for the runtime protection on the bare metal + machine. Known values are: "Audit", "Disabled", "OnDemand", "Passive", and "RealTime". + :vartype enforcement_level: str or + ~azure.mgmt.networkcloud.models.RuntimeProtectionEnforcementLevel :ivar scan_completed_time: The timestamp of the most recently completed scan, or empty if there has never been a scan. :vartype scan_completed_time: ~datetime.datetime @@ -8016,12 +8887,32 @@ class RuntimeProtectionStatus(_Model): :vartype scan_started_time: ~datetime.datetime """ + agent_health_status: Optional[Union[str, "_models.RuntimeProtectionAgentHealthStatus"]] = rest_field( + name="agentHealthStatus", visibility=["read"] + ) + """The runtime protection agent health status. Known values are: \"Healthy\" and \"Unhealthy\".""" + agent_health_status_issues: Optional[list[str]] = rest_field(name="agentHealthStatusIssues", visibility=["read"]) + """The runtime protection agent health status issues, if present.""" + agent_license_status: Optional[Union[str, "_models.RuntimeProtectionAgentLicenseStatus"]] = rest_field( + name="agentLicenseStatus", visibility=["read"] + ) + """The runtime protection agent license status. Known values are: \"Licensed\" and \"Unlicensed\".""" + definition_update_mode: Optional[Union[str, "_models.RuntimeProtectionDefinitionUpdateMode"]] = rest_field( + name="definitionUpdateMode", visibility=["read"] + ) + """The definition update mode for runtime protection. Known values are: \"Automatic\" and + \"None\".""" definitions_last_updated: Optional[datetime.datetime] = rest_field( name="definitionsLastUpdated", visibility=["read"], format="rfc3339" ) """The timestamp when the malware definitions were last updated.""" definitions_version: Optional[str] = rest_field(name="definitionsVersion", visibility=["read"]) """The version of the malware definitions.""" + enforcement_level: Optional[Union[str, "_models.RuntimeProtectionEnforcementLevel"]] = rest_field( + name="enforcementLevel", visibility=["read"] + ) + """The enforcement level set for the runtime protection on the bare metal machine. Known values + are: \"Audit\", \"Disabled\", \"OnDemand\", \"Passive\", and \"RealTime\".""" scan_completed_time: Optional[datetime.datetime] = rest_field( name="scanCompletedTime", visibility=["read"], format="rfc3339" ) @@ -8373,20 +9264,22 @@ class StorageAppliance(TrackedResource): Required.""" __flattened_items = [ + "administrator_credentials", "rack_id", - "storage_appliance_sku_id", "rack_slot", "serial_number", - "administrator_credentials", + "storage_appliance_sku_id", "ca_certificate", "capacity", "capacity_used", "cluster_id", "detailed_status", "detailed_status_message", + "expansion_shelves", "management_ipv4_address", "manufacturer", "model", + "monitoring_configuration_status", "remote_vendor_management_feature", "remote_vendor_management_status", "secret_rotation_status", @@ -8558,6 +9451,82 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class StorageApplianceExpansionShelf(_Model): + """StorageApplianceExpansionShelf represents an expansion shelf connected to a storage appliance. + + :ivar model: The model of the expansion shelf. + :vartype model: str + :ivar version: The version of the expansion shelf. + :vartype version: str + """ + + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model of the expansion shelf.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the expansion shelf.""" + + @overload + def __init__( + self, + *, + model: Optional[str] = None, + 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) + + +class StorageApplianceMonitoringConfigurationStatus(_Model): # pylint: disable=name-too-long + """The monitoring configuration status of the storage appliance. + + :ivar log_level: The log level for the monitoring configuration status of the storage + appliance. Known values are: "Default" and "Nexus". + :vartype log_level: str or + ~azure.mgmt.networkcloud.models.StorageApplianceMetricsConfigurationStatusLogLevel + :ivar metrics_level: The metrics level for the monitoring configuration status of the storage + appliance. Known values are: "Default" and "Nexus". + :vartype metrics_level: str or + ~azure.mgmt.networkcloud.models.StorageApplianceMetricsConfigurationStatusMetricsLevel + """ + + log_level: Optional[Union[str, "_models.StorageApplianceMetricsConfigurationStatusLogLevel"]] = rest_field( + name="logLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """The log level for the monitoring configuration status of the storage appliance. Known values + are: \"Default\" and \"Nexus\".""" + metrics_level: Optional[Union[str, "_models.StorageApplianceMetricsConfigurationStatusMetricsLevel"]] = rest_field( + name="metricsLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """The metrics level for the monitoring configuration status of the storage appliance. Known + values are: \"Default\" and \"Nexus\".""" + + @overload + def __init__( + self, + *, + log_level: Optional[Union[str, "_models.StorageApplianceMetricsConfigurationStatusLogLevel"]] = None, + metrics_level: Optional[Union[str, "_models.StorageApplianceMetricsConfigurationStatusMetricsLevel"]] = 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 StorageAppliancePatchParameters(_Model): """StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. @@ -8648,18 +9617,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class StorageApplianceProperties(_Model): """StorageApplianceProperties represents the properties of the storage appliance. + :ivar administrator_credentials: The credentials of the administrative interface on this + storage appliance. Required. + :vartype administrator_credentials: ~azure.mgmt.networkcloud.models.AdministrativeCredentials :ivar rack_id: The resource ID of the rack where this storage appliance resides. Required. :vartype rack_id: str - :ivar storage_appliance_sku_id: The SKU for the storage appliance. Required. - :vartype storage_appliance_sku_id: str :ivar rack_slot: The slot the storage appliance is in the rack based on the BOM configuration. Required. :vartype rack_slot: int :ivar serial_number: The serial number for the storage appliance. Required. :vartype serial_number: str - :ivar administrator_credentials: The credentials of the administrative interface on this - storage appliance. Required. - :vartype administrator_credentials: ~azure.mgmt.networkcloud.models.AdministrativeCredentials + :ivar storage_appliance_sku_id: The SKU for the storage appliance. Required. + :vartype storage_appliance_sku_id: str :ivar ca_certificate: The CA certificate information issued by the platform for connecting to TLS interfaces for the storage appliance. Callers add this certificate to their trusted CA store to allow secure communication with the storage appliance. @@ -8675,6 +9644,9 @@ class StorageApplianceProperties(_Model): :vartype detailed_status: str or ~azure.mgmt.networkcloud.models.StorageApplianceDetailedStatus :ivar detailed_status_message: The descriptive message about the current detailed status. :vartype detailed_status_message: str + :ivar expansion_shelves: The list of expansion shelves connected to the storage appliance. + :vartype expansion_shelves: + list[~azure.mgmt.networkcloud.models.StorageApplianceExpansionShelf] :ivar management_ipv4_address: The endpoint for the management interface of the storage appliance. :vartype management_ipv4_address: str @@ -8682,6 +9654,10 @@ class StorageApplianceProperties(_Model): :vartype manufacturer: str :ivar model: The model of the storage appliance. :vartype model: str + :ivar monitoring_configuration_status: The monitoring configuration status of the storage + appliance. + :vartype monitoring_configuration_status: + ~azure.mgmt.networkcloud.models.StorageApplianceMonitoringConfigurationStatus :ivar remote_vendor_management_feature: The indicator of whether the storage appliance supports remote vendor management. Known values are: "Supported" and "Unsupported". :vartype remote_vendor_management_feature: str or @@ -8701,18 +9677,18 @@ class StorageApplianceProperties(_Model): ~azure.mgmt.networkcloud.models.StorageApplianceProvisioningState """ + administrator_credentials: "_models.AdministrativeCredentials" = rest_field( + name="administratorCredentials", visibility=["read", "create"] + ) + """The credentials of the administrative interface on this storage appliance. Required.""" rack_id: str = rest_field(name="rackId", visibility=["read", "create"]) """The resource ID of the rack where this storage appliance resides. Required.""" - storage_appliance_sku_id: str = rest_field(name="storageApplianceSkuId", visibility=["read", "create"]) - """The SKU for the storage appliance. Required.""" rack_slot: int = rest_field(name="rackSlot", visibility=["read", "create"]) """The slot the storage appliance is in the rack based on the BOM configuration. Required.""" serial_number: str = rest_field(name="serialNumber", visibility=["read", "create", "update", "delete", "query"]) """The serial number for the storage appliance. Required.""" - administrator_credentials: "_models.AdministrativeCredentials" = rest_field( - name="administratorCredentials", visibility=["read", "create"] - ) - """The credentials of the administrative interface on this storage appliance. Required.""" + storage_appliance_sku_id: str = rest_field(name="storageApplianceSkuId", visibility=["read", "create"]) + """The SKU for the storage appliance. Required.""" ca_certificate: Optional["_models.CertificateInfo"] = rest_field(name="caCertificate", visibility=["read"]) """The CA certificate information issued by the platform for connecting to TLS interfaces for the storage appliance. Callers add this certificate to their trusted CA store to allow secure @@ -8730,12 +9706,20 @@ class StorageApplianceProperties(_Model): \"Error\", and \"Provisioning\".""" detailed_status_message: Optional[str] = rest_field(name="detailedStatusMessage", visibility=["read"]) """The descriptive message about the current detailed status.""" + expansion_shelves: Optional[list["_models.StorageApplianceExpansionShelf"]] = rest_field( + name="expansionShelves", visibility=["read"] + ) + """The list of expansion shelves connected to the storage appliance.""" management_ipv4_address: Optional[str] = rest_field(name="managementIpv4Address", visibility=["read"]) """The endpoint for the management interface of the storage appliance.""" manufacturer: Optional[str] = rest_field(visibility=["read"]) """The manufacturer of the storage appliance.""" model: Optional[str] = rest_field(visibility=["read"]) """The model of the storage appliance.""" + monitoring_configuration_status: Optional["_models.StorageApplianceMonitoringConfigurationStatus"] = rest_field( + name="monitoringConfigurationStatus", visibility=["read"] + ) + """The monitoring configuration status of the storage appliance.""" remote_vendor_management_feature: Optional[Union[str, "_models.RemoteVendorManagementFeature"]] = rest_field( name="remoteVendorManagementFeature", visibility=["read"] ) @@ -8763,11 +9747,11 @@ class StorageApplianceProperties(_Model): def __init__( self, *, + administrator_credentials: "_models.AdministrativeCredentials", rack_id: str, - storage_appliance_sku_id: str, rack_slot: int, serial_number: str, - administrator_credentials: "_models.AdministrativeCredentials", + storage_appliance_sku_id: str, ) -> None: ... @overload @@ -9961,6 +10945,7 @@ class Volume(TrackedResource): "size_mi_b", "storage_appliance_id", "allocated_size_mi_b", + "assigned_storage_appliance_id", "attached_to", "detailed_status", "detailed_status_message", @@ -10044,6 +11029,9 @@ class VolumeProperties(_Model): :vartype storage_appliance_id: str :ivar allocated_size_mi_b: The allocated size of the volume in Mebibytes. :vartype allocated_size_mi_b: int + :ivar assigned_storage_appliance_id: The assigned resource ID of the storage appliance that + hosts the volume. + :vartype assigned_storage_appliance_id: str :ivar attached_to: The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. :vartype attached_to: list[str] @@ -10067,6 +11055,8 @@ class VolumeProperties(_Model): """The resource ID of the storage appliance that hosts the volume.""" allocated_size_mi_b: Optional[int] = rest_field(name="allocatedSizeMiB", visibility=["read"]) """The allocated size of the volume in Mebibytes.""" + assigned_storage_appliance_id: Optional[str] = rest_field(name="assignedStorageApplianceId", visibility=["read"]) + """The assigned resource ID of the storage appliance that hosts the volume.""" attached_to: Optional[list[str]] = rest_field(name="attachedTo", visibility=["read"]) """The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters.""" diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/operations/__init__.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/operations/__init__.py index a3eb236d5878..d49d351ab326 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/operations/__init__.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/operations/__init__.py @@ -13,11 +13,13 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore +from ._operations import AccessBridgesOperations # type: ignore from ._operations import BareMetalMachinesOperations # type: ignore from ._operations import CloudServicesNetworksOperations # type: ignore from ._operations import ClusterManagersOperations # type: ignore from ._operations import ClustersOperations # type: ignore from ._operations import KubernetesClustersOperations # type: ignore +from ._operations import KubernetesVersionsOperations # type: ignore from ._operations import L2NetworksOperations # type: ignore from ._operations import L3NetworksOperations # type: ignore from ._operations import RackSkusOperations # type: ignore @@ -39,11 +41,13 @@ __all__ = [ "Operations", + "AccessBridgesOperations", "BareMetalMachinesOperations", "CloudServicesNetworksOperations", "ClusterManagersOperations", "ClustersOperations", "KubernetesClustersOperations", + "KubernetesVersionsOperations", "L2NetworksOperations", "L3NetworksOperations", "RackSkusOperations", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/operations/_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/operations/_operations.py index 88c7a9b87667..b3114cdc784d 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/operations/_operations.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/operations/_operations.py @@ -38,6 +38,7 @@ from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer from .._utils.utils import prep_if_match, prep_if_none_match +from .._validation import api_version_validation T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] @@ -52,7 +53,7 @@ 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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,13 +68,224 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_access_bridges_get_request( + resource_group_name: str, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + 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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/accessBridges/{accessBridgeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessBridgeName": _SERIALIZER.url("access_bridge_name", access_bridge_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_access_bridges_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + 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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/accessBridges/{accessBridgeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessBridgeName": _SERIALIZER.url("access_bridge_name", access_bridge_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_access_bridges_update_request( + resource_group_name: str, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/accessBridges/{accessBridgeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessBridgeName": _SERIALIZER.url("access_bridge_name", access_bridge_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") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_access_bridges_delete_request( + resource_group_name: str, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **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-05-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/accessBridges/{accessBridgeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accessBridgeName": _SERIALIZER.url("access_bridge_name", access_bridge_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_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_access_bridges_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/accessBridges" + 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") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_access_bridges_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/accessBridges" + 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") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_bare_metal_machines_get_request( resource_group_name: str, bare_metal_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +320,7 @@ def build_bare_metal_machines_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +363,7 @@ def build_bare_metal_machines_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +405,7 @@ def build_bare_metal_machines_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" path_format_arguments = { @@ -229,7 +441,7 @@ def build_bare_metal_machines_list_by_resource_group_request( # pylint: disable _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +472,7 @@ def build_bare_metal_machines_list_by_subscription_request( # pylint: disable=n _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -291,7 +503,7 @@ def build_bare_metal_machines_cordon_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon" path_format_arguments = { @@ -319,7 +531,7 @@ def build_bare_metal_machines_power_off_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff" path_format_arguments = { @@ -343,9 +555,11 @@ def build_bare_metal_machines_power_off_request( # pylint: disable=name-too-lon def build_bare_metal_machines_reimage_request( # pylint: disable=name-too-long resource_group_name: str, bare_metal_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", "2025-09-01")) + 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-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/reimage" path_format_arguments = { @@ -359,7 +573,11 @@ def build_bare_metal_machines_reimage_request( # pylint: disable=name-too-long # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # 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_bare_metal_machines_replace_request( # pylint: disable=name-too-long @@ -369,7 +587,7 @@ def build_bare_metal_machines_replace_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace" path_format_arguments = { @@ -395,7 +613,7 @@ def build_bare_metal_machines_restart_request( # pylint: disable=name-too-long ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/restart" path_format_arguments = { @@ -419,7 +637,7 @@ def build_bare_metal_machines_run_command_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand" path_format_arguments = { @@ -447,7 +665,7 @@ def build_bare_metal_machines_run_data_extracts_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts" path_format_arguments = { @@ -475,7 +693,7 @@ def build_bare_metal_machines_run_data_extracts_restricted_request( # pylint: d _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtractsRestricted" path_format_arguments = { @@ -503,7 +721,7 @@ def build_bare_metal_machines_run_read_commands_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands" path_format_arguments = { @@ -529,7 +747,7 @@ def build_bare_metal_machines_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/start" path_format_arguments = { @@ -551,7 +769,7 @@ def build_bare_metal_machines_uncordon_request( # pylint: disable=name-too-long ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/uncordon" path_format_arguments = { @@ -574,7 +792,7 @@ def build_cloud_services_networks_get_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -609,7 +827,7 @@ def build_cloud_services_networks_create_or_update_request( # pylint: disable=n _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -652,7 +870,7 @@ def build_cloud_services_networks_update_request( # pylint: disable=name-too-lo _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -694,7 +912,7 @@ def build_cloud_services_networks_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" path_format_arguments = { @@ -730,7 +948,7 @@ def build_cloud_services_networks_list_by_resource_group_request( # pylint: dis _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -761,7 +979,7 @@ def build_cloud_services_networks_list_by_subscription_request( # pylint: disab _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -791,7 +1009,7 @@ def build_cluster_managers_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -826,7 +1044,7 @@ def build_cluster_managers_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -869,7 +1087,7 @@ def build_cluster_managers_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -911,7 +1129,7 @@ def build_cluster_managers_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" path_format_arguments = { @@ -947,7 +1165,7 @@ def build_cluster_managers_list_by_resource_group_request( # pylint: disable=na _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -978,7 +1196,7 @@ def build_cluster_managers_list_by_subscription_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1002,13 +1220,41 @@ def build_cluster_managers_list_by_subscription_request( # pylint: disable=name return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_cluster_managers_update_relay_private_endpoint_connection_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_manager_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-05-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}/updateRelayPrivateEndpointConnection" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterManagerName": _SERIALIZER.url("cluster_manager_name", cluster_manager_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_clusters_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1043,7 +1289,7 @@ def build_clusters_create_or_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1086,7 +1332,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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1128,7 +1374,7 @@ def build_clusters_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" path_format_arguments = { @@ -1164,7 +1410,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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1197,7 +1443,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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1228,7 +1474,7 @@ def build_clusters_continue_update_version_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion" path_format_arguments = { @@ -1256,7 +1502,7 @@ def build_clusters_deploy_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy" path_format_arguments = { @@ -1277,16 +1523,16 @@ def build_clusters_deploy_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_clusters_scan_runtime_request( +def build_clusters_inspect_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/inspect" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1305,16 +1551,16 @@ def build_clusters_scan_runtime_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_clusters_update_version_request( +def build_clusters_rotate_credential_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/rotateCredential" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1333,21 +1579,20 @@ def build_clusters_update_version_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_kubernetes_clusters_get_request( - resource_group_name: str, kubernetes_cluster_name: str, subscription_id: str, **kwargs: Any +def build_clusters_scan_runtime_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", "2025-09-01")) - accept = _headers.pop("Accept", "application/json") - + 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-05-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "kubernetesClusterName": _SERIALIZER.url("kubernetes_cluster_name", kubernetes_cluster_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1356,33 +1601,26 @@ def build_kubernetes_clusters_get_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_kubernetes_clusters_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - kubernetes_cluster_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any +def build_clusters_update_version_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", "2025-09-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "kubernetesClusterName": _SERIALIZER.url("kubernetes_cluster_name", kubernetes_cluster_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1393,8 +1631,72 @@ def build_kubernetes_clusters_create_or_update_request( # pylint: disable=name- # 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") - if_match = prep_if_match(etag, match_condition) + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_kubernetes_clusters_get_request( + resource_group_name: str, kubernetes_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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "kubernetesClusterName": _SERIALIZER.url("kubernetes_cluster_name", kubernetes_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_kubernetes_clusters_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + kubernetes_cluster_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "kubernetesClusterName": _SERIALIZER.url("kubernetes_cluster_name", kubernetes_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") + if_match = prep_if_match(etag, match_condition) if if_match is not None: _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") if_none_match = prep_if_none_match(etag, match_condition) @@ -1417,7 +1719,7 @@ def build_kubernetes_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1459,7 +1761,7 @@ def build_kubernetes_clusters_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" path_format_arguments = { @@ -1495,7 +1797,7 @@ def build_kubernetes_clusters_list_by_resource_group_request( # pylint: disable _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1526,7 +1828,7 @@ def build_kubernetes_clusters_list_by_subscription_request( # pylint: disable=n _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1557,7 +1859,7 @@ def build_kubernetes_clusters_restart_node_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode" path_format_arguments = { @@ -1578,13 +1880,230 @@ def build_kubernetes_clusters_restart_node_request( # pylint: disable=name-too- return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_kubernetes_versions_get_request( + resource_group_name: str, kubernetes_version_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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesVersions/{kubernetesVersionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "kubernetesVersionName": _SERIALIZER.url("kubernetes_version_name", kubernetes_version_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_kubernetes_versions_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + kubernetes_version_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesVersions/{kubernetesVersionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "kubernetesVersionName": _SERIALIZER.url("kubernetes_version_name", kubernetes_version_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") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_kubernetes_versions_update_request( + resource_group_name: str, + kubernetes_version_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesVersions/{kubernetesVersionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "kubernetesVersionName": _SERIALIZER.url("kubernetes_version_name", kubernetes_version_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") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_kubernetes_versions_delete_request( + resource_group_name: str, + kubernetes_version_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **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-05-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesVersions/{kubernetesVersionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "kubernetesVersionName": _SERIALIZER.url("kubernetes_version_name", kubernetes_version_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_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_kubernetes_versions_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip_token: Optional[str] = None, + **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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesVersions" + 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") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_kubernetes_versions_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **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-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/kubernetesVersions" + 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") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_l2_networks_get_request( resource_group_name: str, l2_network_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1619,7 +2138,7 @@ def build_l2_networks_create_or_update_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1662,7 +2181,7 @@ def build_l2_networks_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1704,7 +2223,7 @@ def build_l2_networks_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" path_format_arguments = { @@ -1740,7 +2259,7 @@ def build_l2_networks_list_by_resource_group_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1773,7 +2292,7 @@ def build_l2_networks_list_by_subscription_request( # pylint: disable=name-too- _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1803,7 +2322,7 @@ def build_l3_networks_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1838,7 +2357,7 @@ def build_l3_networks_create_or_update_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1881,7 +2400,7 @@ def build_l3_networks_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1923,7 +2442,7 @@ def build_l3_networks_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" path_format_arguments = { @@ -1959,7 +2478,7 @@ def build_l3_networks_list_by_resource_group_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1992,7 +2511,7 @@ def build_l3_networks_list_by_subscription_request( # pylint: disable=name-too- _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2020,7 +2539,7 @@ def build_rack_skus_get_request(rack_sku_name: str, subscription_id: str, **kwar _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2047,7 +2566,7 @@ def build_rack_skus_list_by_subscription_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2073,7 +2592,7 @@ def build_racks_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2108,7 +2627,7 @@ def build_racks_create_or_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2151,7 +2670,7 @@ def build_racks_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2193,7 +2712,7 @@ def build_racks_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" path_format_arguments = { @@ -2229,7 +2748,7 @@ def build_racks_list_by_resource_group_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2260,7 +2779,7 @@ def build_racks_list_by_subscription_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2290,7 +2809,7 @@ def build_storage_appliances_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2325,7 +2844,7 @@ def build_storage_appliances_create_or_update_request( # pylint: disable=name-t _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2368,7 +2887,7 @@ def build_storage_appliances_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2410,7 +2929,7 @@ def build_storage_appliances_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" path_format_arguments = { @@ -2446,7 +2965,7 @@ def build_storage_appliances_list_by_resource_group_request( # pylint: disable= _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2477,7 +2996,7 @@ def build_storage_appliances_list_by_subscription_request( # pylint: disable=na _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2506,7 +3025,7 @@ def build_storage_appliances_disable_remote_vendor_management_request( # pylint ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/disableRemoteVendorManagement" path_format_arguments = { @@ -2530,7 +3049,7 @@ def build_storage_appliances_enable_remote_vendor_management_request( # pylint: _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement" path_format_arguments = { @@ -2558,7 +3077,7 @@ def build_storage_appliances_run_read_commands_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/runReadCommands" path_format_arguments = { @@ -2585,7 +3104,7 @@ def build_trunked_networks_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2620,7 +3139,7 @@ def build_trunked_networks_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2663,7 +3182,7 @@ def build_trunked_networks_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2705,7 +3224,7 @@ def build_trunked_networks_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" path_format_arguments = { @@ -2741,7 +3260,7 @@ def build_trunked_networks_list_by_resource_group_request( # pylint: disable=na _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2772,7 +3291,7 @@ def build_trunked_networks_list_by_subscription_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2802,7 +3321,7 @@ def build_virtual_machines_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2837,7 +3356,7 @@ def build_virtual_machines_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2880,7 +3399,7 @@ def build_virtual_machines_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2922,7 +3441,7 @@ def build_virtual_machines_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" path_format_arguments = { @@ -2958,7 +3477,7 @@ def build_virtual_machines_list_by_resource_group_request( # pylint: disable=na _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2989,7 +3508,7 @@ def build_virtual_machines_list_by_subscription_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3020,7 +3539,7 @@ def build_virtual_machines_assign_relay_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/assignRelay" path_format_arguments = { @@ -3048,7 +3567,7 @@ def build_virtual_machines_power_off_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff" path_format_arguments = { @@ -3074,7 +3593,7 @@ def build_virtual_machines_reimage_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/reimage" path_format_arguments = { @@ -3096,7 +3615,7 @@ def build_virtual_machines_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/restart" path_format_arguments = { @@ -3118,7 +3637,7 @@ def build_virtual_machines_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/start" path_format_arguments = { @@ -3141,7 +3660,7 @@ def build_volumes_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3176,7 +3695,7 @@ def build_volumes_create_or_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3219,7 +3738,7 @@ def build_volumes_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3261,7 +3780,7 @@ def build_volumes_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" path_format_arguments = { @@ -3297,7 +3816,7 @@ def build_volumes_list_by_resource_group_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3328,7 +3847,7 @@ def build_volumes_list_by_subscription_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3362,7 +3881,7 @@ def build_bare_metal_machine_key_sets_get_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3401,7 +3920,7 @@ def build_bare_metal_machine_key_sets_create_or_update_request( # pylint: disab _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3448,7 +3967,7 @@ def build_bare_metal_machine_key_sets_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3494,7 +4013,7 @@ def build_bare_metal_machine_key_sets_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" path_format_arguments = { @@ -3534,7 +4053,7 @@ def build_bare_metal_machine_key_sets_list_by_cluster_request( # pylint: disabl _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3566,7 +4085,7 @@ def build_bmc_key_sets_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3603,7 +4122,7 @@ def build_bmc_key_sets_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3648,7 +4167,7 @@ def build_bmc_key_sets_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3692,7 +4211,7 @@ def build_bmc_key_sets_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" path_format_arguments = { @@ -3730,7 +4249,7 @@ def build_bmc_key_sets_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3762,7 +4281,7 @@ def build_agent_pools_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3799,7 +4318,7 @@ def build_agent_pools_create_or_update_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3844,7 +4363,7 @@ def build_agent_pools_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3888,7 +4407,7 @@ def build_agent_pools_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" path_format_arguments = { @@ -3926,7 +4445,7 @@ def build_agent_pools_list_by_kubernetes_cluster_request( # pylint: disable=nam _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3958,7 +4477,7 @@ def build_kubernetes_cluster_features_get_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3995,7 +4514,7 @@ def build_kubernetes_cluster_features_create_or_update_request( # pylint: disab _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4040,7 +4559,7 @@ def build_kubernetes_cluster_features_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4084,7 +4603,7 @@ def build_kubernetes_cluster_features_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" path_format_arguments = { @@ -4122,7 +4641,7 @@ def build_kubernetes_cluster_features_list_by_kubernetes_cluster_request( # pyl _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4154,7 +4673,7 @@ def build_consoles_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4191,7 +4710,7 @@ def build_consoles_create_or_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4236,7 +4755,7 @@ def build_consoles_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4280,7 +4799,7 @@ def build_consoles_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" path_format_arguments = { @@ -4318,7 +4837,7 @@ def build_consoles_list_by_virtual_machine_request( # pylint: disable=name-too- _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4350,7 +4869,7 @@ def build_metrics_configurations_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4387,7 +4906,7 @@ def build_metrics_configurations_create_or_update_request( # pylint: disable=na _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4432,7 +4951,7 @@ def build_metrics_configurations_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4476,7 +4995,7 @@ def build_metrics_configurations_delete_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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" path_format_arguments = { @@ -4514,7 +5033,7 @@ def build_metrics_configurations_list_by_cluster_request( # pylint: disable=nam _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", "2025-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -4647,14 +5166,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class BareMetalMachinesOperations: # pylint: disable=too-many-public-methods +class AccessBridgesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.networkcloud.NetworkCloudMgmtClient`'s - :attr:`bare_metal_machines` attribute. + :attr:`access_bridges` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -4665,16 +5184,32 @@ 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, bare_metal_machine_name: str, **kwargs: Any) -> _models.BareMetalMachine: - """Get properties of the provided bare metal machine. + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + def get( + self, resource_group_name: str, access_bridge_name: Union[str, _models.AccessBridgeAllowedName], **kwargs: Any + ) -> _models.AccessBridge: + """Get the properties of the provided access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :return: BareMetalMachine. The BareMetalMachine is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.BareMetalMachine + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :return: AccessBridge. The AccessBridge is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.AccessBridge :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4688,11 +5223,11 @@ def get(self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.BareMetalMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.AccessBridge] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_get_request( + _request = build_access_bridges_get_request( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4727,21 +5262,32 @@ def get(self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.BareMetalMachine, response.json()) + deserialized = _deserialize(_models.AccessBridge, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def _create_or_update_initial( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: Union[_models.BareMetalMachine, JSON, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: Union[_models.AccessBridge, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4750,12 +5296,6 @@ def _create_or_update_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4766,17 +5306,15 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(bare_metal_machine_parameters, (IOBase, bytes)): - _content = bare_metal_machine_parameters + if isinstance(access_bridge, (IOBase, bytes)): + _content = access_bridge else: - _content = json.dumps(bare_metal_machine_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(access_bridge, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_bare_metal_machines_create_or_update_request( + _request = build_access_bridges_create_or_update_request( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -4825,36 +5363,28 @@ def _create_or_update_initial( def begin_create_or_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: _models.BareMetalMachine, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: _models.AccessBridge, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.BareMetalMachine]: - """Create a new bare metal machine or update the properties of the existing one. All customer - initiated requests will be rejected as the life cycle of this resource is managed by the - system. + ) -> LROPoller[_models.AccessBridge]: + """Create a new access bridge or update the properties of the existing access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_parameters: The request body. Required. - :type bare_metal_machine_parameters: ~azure.mgmt.networkcloud.models.BareMetalMachine + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge: The access bridge configuration. Required. + :type access_bridge: ~azure.mgmt.networkcloud.models.AccessBridge :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An instance of LROPoller that returns AccessBridge. The AccessBridge is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4862,36 +5392,28 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: JSON, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: JSON, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.BareMetalMachine]: - """Create a new bare metal machine or update the properties of the existing one. All customer - initiated requests will be rejected as the life cycle of this resource is managed by the - system. + ) -> LROPoller[_models.AccessBridge]: + """Create a new access bridge or update the properties of the existing access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_parameters: The request body. Required. - :type bare_metal_machine_parameters: JSON + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge: The access bridge configuration. Required. + :type access_bridge: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An instance of LROPoller that returns AccessBridge. The AccessBridge is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4899,88 +5421,82 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: IO[bytes], + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.BareMetalMachine]: - """Create a new bare metal machine or update the properties of the existing one. All customer - initiated requests will be rejected as the life cycle of this resource is managed by the - system. + ) -> LROPoller[_models.AccessBridge]: + """Create a new access bridge or update the properties of the existing access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_parameters: The request body. Required. - :type bare_metal_machine_parameters: IO[bytes] + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge: The access bridge configuration. Required. + :type access_bridge: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An instance of LROPoller that returns AccessBridge. The AccessBridge is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def begin_create_or_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_parameters: Union[_models.BareMetalMachine, JSON, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge: Union[_models.AccessBridge, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.BareMetalMachine]: - """Create a new bare metal machine or update the properties of the existing one. All customer - initiated requests will be rejected as the life cycle of this resource is managed by the - system. + ) -> LROPoller[_models.AccessBridge]: + """Create a new access bridge or update the properties of the existing access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_parameters: The request body. Is one of the following types: - BareMetalMachine, JSON, IO[bytes] Required. - :type bare_metal_machine_parameters: ~azure.mgmt.networkcloud.models.BareMetalMachine or JSON - or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge: The access bridge configuration. Is one of the following types: + AccessBridge, JSON, IO[bytes] Required. + :type access_bridge: ~azure.mgmt.networkcloud.models.AccessBridge or JSON or IO[bytes] + :return: An instance of LROPoller that returns AccessBridge. The AccessBridge is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :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.BareMetalMachine] = kwargs.pop("cls", None) + cls: ClsType[_models.AccessBridge] = 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, - bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_parameters=bare_metal_machine_parameters, - etag=etag, - match_condition=match_condition, + access_bridge_name=access_bridge_name, + access_bridge=access_bridge, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4992,7 +5508,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.BareMetalMachine, response.json()) + deserialized = _deserialize(_models.AccessBridge, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -5010,23 +5526,37 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.BareMetalMachine].from_continuation_token( + return LROPoller[_models.AccessBridge].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.BareMetalMachine]( + return LROPoller[_models.AccessBridge]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def _update_initial( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[ - Union[_models.BareMetalMachinePatchParameters, JSON, IO[bytes]] - ] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[Union[_models.AccessBridgePatchParameters, JSON, IO[bytes]]] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -5050,22 +5580,22 @@ def _update_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if bare_metal_machine_update_parameters else None + content_type = content_type if access_bridge_update_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if bare_metal_machine_update_parameters else None + content_type = content_type or "application/json" if access_bridge_update_parameters else None _content = None - if isinstance(bare_metal_machine_update_parameters, (IOBase, bytes)): - _content = bare_metal_machine_update_parameters + if isinstance(access_bridge_update_parameters, (IOBase, bytes)): + _content = access_bridge_update_parameters else: - if bare_metal_machine_update_parameters is not None: - _content = json.dumps(bare_metal_machine_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if access_bridge_update_parameters is not None: + _content = json.dumps(access_bridge_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_bare_metal_machines_update_request( + _request = build_access_bridges_update_request( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -5118,25 +5648,26 @@ def _update_initial( def begin_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[_models.BareMetalMachinePatchParameters] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[_models.AccessBridgePatchParameters] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.BareMetalMachine]: - """Patch properties of the provided bare metal machine, or update tags associated with the bare - metal machine. Properties and tag updates can be done independently. + ) -> LROPoller[_models.AccessBridge]: + """Update properties of the provided access bridge, or update tags associated with the access + bridge. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_update_parameters: The request body. Default value is None. - :type bare_metal_machine_update_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge_update_parameters: The request body. Default value is None. + :type access_bridge_update_parameters: + ~azure.mgmt.networkcloud.models.AccessBridgePatchParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5145,9 +5676,9 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An instance of LROPoller that returns AccessBridge. The AccessBridge is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5155,24 +5686,25 @@ def begin_update( def begin_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[JSON] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.BareMetalMachine]: - """Patch properties of the provided bare metal machine, or update tags associated with the bare - metal machine. Properties and tag updates can be done independently. + ) -> LROPoller[_models.AccessBridge]: + """Update properties of the provided access bridge, or update tags associated with the access + bridge. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_update_parameters: The request body. Default value is None. - :type bare_metal_machine_update_parameters: JSON + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge_update_parameters: The request body. Default value is None. + :type access_bridge_update_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5181,9 +5713,9 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An instance of LROPoller that returns AccessBridge. The AccessBridge is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5191,24 +5723,25 @@ def begin_update( def begin_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[IO[bytes]] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.BareMetalMachine]: - """Patch properties of the provided bare metal machine, or update tags associated with the bare - metal machine. Properties and tag updates can be done independently. + ) -> LROPoller[_models.AccessBridge]: + """Update properties of the provided access bridge, or update tags associated with the access + bridge. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_update_parameters: The request body. Default value is None. - :type bare_metal_machine_update_parameters: IO[bytes] + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge_update_parameters: The request body. Default value is None. + :type access_bridge_update_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 @@ -5217,61 +5750,76 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An instance of LROPoller that returns AccessBridge. The AccessBridge is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def begin_update( self, resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_update_parameters: Optional[ - Union[_models.BareMetalMachinePatchParameters, JSON, IO[bytes]] - ] = None, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], + access_bridge_update_parameters: Optional[Union[_models.AccessBridgePatchParameters, JSON, IO[bytes]]] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.BareMetalMachine]: - """Patch properties of the provided bare metal machine, or update tags associated with the bare - metal machine. Properties and tag updates can be done independently. + ) -> LROPoller[_models.AccessBridge]: + """Update properties of the provided access bridge, or update tags associated with the access + bridge. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_update_parameters: The request body. Is one of the following types: - BareMetalMachinePatchParameters, JSON, IO[bytes] Default value is None. - :type bare_metal_machine_update_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters or JSON or IO[bytes] + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName + :param access_bridge_update_parameters: The request body. Is one of the following types: + AccessBridgePatchParameters, JSON, IO[bytes] Default value is None. + :type access_bridge_update_parameters: + ~azure.mgmt.networkcloud.models.AccessBridgePatchParameters or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An instance of LROPoller that returns AccessBridge. The AccessBridge is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.AccessBridge] :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)) - content_type = content_type if bare_metal_machine_update_parameters else None - cls: ClsType[_models.BareMetalMachine] = kwargs.pop("cls", None) + content_type = content_type if access_bridge_update_parameters else None + cls: ClsType[_models.AccessBridge] = 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, - bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_update_parameters=bare_metal_machine_update_parameters, + access_bridge_name=access_bridge_name, + access_bridge_update_parameters=access_bridge_update_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -5285,7 +5833,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.BareMetalMachine, response.json()) + deserialized = _deserialize(_models.AccessBridge, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -5303,20 +5851,34 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.BareMetalMachine].from_continuation_token( + return LROPoller[_models.AccessBridge].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.BareMetalMachine]( + return LROPoller[_models.AccessBridge]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def _delete_initial( self, resource_group_name: str, - bare_metal_machine_name: str, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -5341,9 +5903,9 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_delete_request( + _request = build_access_bridges_delete_request( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -5388,23 +5950,37 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "access_bridge_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def begin_delete( self, resource_group_name: str, - bare_metal_machine_name: str, + access_bridge_name: Union[str, _models.AccessBridgeAllowedName], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Delete the provided bare metal machine. All customer initiated requests will be rejected as the - life cycle of this resource is managed by the system. + """Delete the specified access bridge. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str + :param access_bridge_name: The name of the access bridge. Known values are: "Bastion", + "PrivateVault", and "StorageDashboard". Required. + :type access_bridge_name: str or ~azure.mgmt.networkcloud.models.AccessBridgeAllowedName :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -5425,7 +6001,7 @@ def begin_delete( if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_name, + access_bridge_name=access_bridge_name, etag=etag, match_condition=match_condition, cls=lambda x, y, z: x, @@ -5470,10 +6046,24 @@ def get_long_running_output(pipeline_response): ) @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "top", + "skip_token", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def list_by_resource_group( self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.BareMetalMachine"]: - """Get a list of bare metal machines in the provided resource group. + ) -> ItemPaged["_models.AccessBridge"]: + """Get a list of access bridges in the provided resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5485,14 +6075,14 @@ def list_by_resource_group( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of BareMetalMachine - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An iterator like instance of AccessBridge + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.BareMetalMachine]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AccessBridge]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5505,7 +6095,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_bare_metal_machines_list_by_resource_group_request( + _request = build_access_bridges_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, top=top, @@ -5546,7 +6136,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.BareMetalMachine], + List[_models.AccessBridge], deserialized.get("value", []), ) if cls: @@ -5575,10 +6165,15 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={"2026-01-01-preview": ["api_version", "subscription_id", "top", "skip_token", "accept"]}, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def list_by_subscription( self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.BareMetalMachine"]: - """Get a list of bare metal machines in the provided subscription. + ) -> ItemPaged["_models.AccessBridge"]: + """Get a list of access bridges in the provided subscription. :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -5587,14 +6182,14 @@ def list_by_subscription( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of BareMetalMachine - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.BareMetalMachine] + :return: An iterator like instance of AccessBridge + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.AccessBridge] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.BareMetalMachine]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AccessBridge]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5607,7 +6202,7 @@ def list_by_subscription( def prepare_request(next_link=None): if not next_link: - _request = build_bare_metal_machines_list_by_subscription_request( + _request = build_access_bridges_list_by_subscription_request( subscription_id=self._config.subscription_id, top=top, skip_token=skip_token, @@ -5647,7 +6242,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.BareMetalMachine], + List[_models.AccessBridge], deserialized.get("value", []), ) if cls: @@ -5675,44 +6270,137 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - def _cordon_initial( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[ - Union[_models.BareMetalMachineCordonParameters, JSON, IO[bytes]] - ] = None, - **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 {} +class BareMetalMachinesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if bare_metal_machine_cordon_parameters else None + Instead, you should access the following operations through + :class:`~azure.mgmt.networkcloud.NetworkCloudMgmtClient`'s + :attr:`bare_metal_machines` 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: NetworkCloudMgmtClientConfiguration = 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, bare_metal_machine_name: str, **kwargs: Any) -> _models.BareMetalMachine: + """Get properties of the provided bare metal machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :return: BareMetalMachine. The BareMetalMachine is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.BareMetalMachine + :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.BareMetalMachine] = kwargs.pop("cls", None) + + _request = build_bare_metal_machines_get_request( + resource_group_name=resource_group_name, + bare_metal_machine_name=bare_metal_machine_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.BareMetalMachine, 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, + bare_metal_machine_name: str, + bare_metal_machine_parameters: Union[_models.BareMetalMachine, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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" if bare_metal_machine_cordon_parameters else None + content_type = content_type or "application/json" _content = None - if isinstance(bare_metal_machine_cordon_parameters, (IOBase, bytes)): - _content = bare_metal_machine_cordon_parameters + if isinstance(bare_metal_machine_parameters, (IOBase, bytes)): + _content = bare_metal_machine_parameters else: - if bare_metal_machine_cordon_parameters is not None: - _content = json.dumps(bare_metal_machine_cordon_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + _content = json.dumps(bare_metal_machine_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_bare_metal_machines_cordon_request( + _request = build_bare_metal_machines_create_or_update_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5732,7 +6420,7 @@ def _cordon_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -5745,8 +6433,10 @@ def _cordon_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -5756,130 +6446,165 @@ def _cordon_initial( return deserialized # type: ignore @overload - def begin_cordon( + def begin_create_or_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[_models.BareMetalMachineCordonParameters] = None, + bare_metal_machine_parameters: _models.BareMetalMachine, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Cordon the provided bare metal machine's Kubernetes node. + ) -> LROPoller[_models.BareMetalMachine]: + """Create a new bare metal machine or update the properties of the existing one. All customer + initiated requests will be rejected as the life cycle of this resource is managed by the + system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_cordon_parameters: The request body. Default value is None. - :type bare_metal_machine_cordon_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineCordonParameters + :param bare_metal_machine_parameters: The request body. Required. + :type bare_metal_machine_parameters: ~azure.mgmt.networkcloud.models.BareMetalMachine :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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_cordon( + def begin_create_or_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[JSON] = None, + bare_metal_machine_parameters: JSON, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Cordon the provided bare metal machine's Kubernetes node. + ) -> LROPoller[_models.BareMetalMachine]: + """Create a new bare metal machine or update the properties of the existing one. All customer + initiated requests will be rejected as the life cycle of this resource is managed by the + system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_cordon_parameters: The request body. Default value is None. - :type bare_metal_machine_cordon_parameters: JSON + :param bare_metal_machine_parameters: The request body. Required. + :type bare_metal_machine_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_cordon( + def begin_create_or_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[IO[bytes]] = None, + bare_metal_machine_parameters: IO[bytes], *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Cordon the provided bare metal machine's Kubernetes node. + ) -> LROPoller[_models.BareMetalMachine]: + """Create a new bare metal machine or update the properties of the existing one. All customer + initiated requests will be rejected as the life cycle of this resource is managed by the + system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_cordon_parameters: The request body. Default value is None. - :type bare_metal_machine_cordon_parameters: IO[bytes] + :param bare_metal_machine_parameters: The request body. Required. + :type bare_metal_machine_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_cordon( + def begin_create_or_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_cordon_parameters: Optional[ - Union[_models.BareMetalMachineCordonParameters, JSON, IO[bytes]] - ] = None, + bare_metal_machine_parameters: Union[_models.BareMetalMachine, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Cordon the provided bare metal machine's Kubernetes node. + ) -> LROPoller[_models.BareMetalMachine]: + """Create a new bare metal machine or update the properties of the existing one. All customer + initiated requests will be rejected as the life cycle of this resource is managed by the + system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_cordon_parameters: The request body. Is one of the following types: - BareMetalMachineCordonParameters, JSON, IO[bytes] Default value is None. - :type bare_metal_machine_cordon_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineCordonParameters or JSON or IO[bytes] - :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :param bare_metal_machine_parameters: The request body. Is one of the following types: + BareMetalMachine, JSON, IO[bytes] Required. + :type bare_metal_machine_parameters: ~azure.mgmt.networkcloud.models.BareMetalMachine or JSON + or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :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)) - content_type = content_type if bare_metal_machine_cordon_parameters else None - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + cls: ClsType[_models.BareMetalMachine] = 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._cordon_initial( + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_cordon_parameters=bare_metal_machine_cordon_parameters, + bare_metal_machine_parameters=bare_metal_machine_parameters, + etag=etag, + match_condition=match_condition, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -5890,14 +6615,10 @@ def begin_cordon( 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.OperationStatusResult, response.json()) + deserialized = _deserialize(_models.BareMetalMachine, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -5913,23 +6634,26 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.OperationStatusResult].from_continuation_token( + return LROPoller[_models.BareMetalMachine].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.OperationStatusResult]( + return LROPoller[_models.BareMetalMachine]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _power_off_initial( + def _update_initial( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[ - Union[_models.BareMetalMachinePowerOffParameters, JSON, IO[bytes]] + bare_metal_machine_update_parameters: Optional[ + Union[_models.BareMetalMachinePatchParameters, JSON, IO[bytes]] ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5938,29 +6662,37 @@ def _power_off_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError 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)) - content_type = content_type if bare_metal_machine_power_off_parameters else None + content_type = content_type if bare_metal_machine_update_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if bare_metal_machine_power_off_parameters else None + content_type = content_type or "application/json" if bare_metal_machine_update_parameters else None _content = None - if isinstance(bare_metal_machine_power_off_parameters, (IOBase, bytes)): - _content = bare_metal_machine_power_off_parameters + if isinstance(bare_metal_machine_update_parameters, (IOBase, bytes)): + _content = bare_metal_machine_update_parameters else: - if bare_metal_machine_power_off_parameters is not None: - _content = json.dumps(bare_metal_machine_power_off_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if bare_metal_machine_update_parameters is not None: + _content = json.dumps(bare_metal_machine_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_bare_metal_machines_power_off_request( + _request = build_bare_metal_machines_update_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -5980,7 +6712,7 @@ def _power_off_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -5993,8 +6725,11 @@ def _power_off_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + 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")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -6004,130 +6739,165 @@ def _power_off_initial( return deserialized # type: ignore @overload - def begin_power_off( + def begin_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[_models.BareMetalMachinePowerOffParameters] = None, + bare_metal_machine_update_parameters: Optional[_models.BareMetalMachinePatchParameters] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Power off the provided bare metal machine. + ) -> LROPoller[_models.BareMetalMachine]: + """Patch properties of the provided bare metal machine, or update tags associated with the bare + metal machine. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_power_off_parameters: The request body. Default value is None. - :type bare_metal_machine_power_off_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters + :param bare_metal_machine_update_parameters: The request body. Default value is None. + :type bare_metal_machine_update_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters :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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_power_off( + def begin_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[JSON] = None, + bare_metal_machine_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Power off the provided bare metal machine. + ) -> LROPoller[_models.BareMetalMachine]: + """Patch properties of the provided bare metal machine, or update tags associated with the bare + metal machine. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_power_off_parameters: The request body. Default value is None. - :type bare_metal_machine_power_off_parameters: JSON + :param bare_metal_machine_update_parameters: The request body. Default value is None. + :type bare_metal_machine_update_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_power_off( + def begin_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[IO[bytes]] = None, + bare_metal_machine_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Power off the provided bare metal machine. + ) -> LROPoller[_models.BareMetalMachine]: + """Patch properties of the provided bare metal machine, or update tags associated with the bare + metal machine. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_power_off_parameters: The request body. Default value is None. - :type bare_metal_machine_power_off_parameters: IO[bytes] + :param bare_metal_machine_update_parameters: The request body. Default value is None. + :type bare_metal_machine_update_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_power_off( + def begin_update( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_power_off_parameters: Optional[ - Union[_models.BareMetalMachinePowerOffParameters, JSON, IO[bytes]] + bare_metal_machine_update_parameters: Optional[ + Union[_models.BareMetalMachinePatchParameters, JSON, IO[bytes]] ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Power off the provided bare metal machine. + ) -> LROPoller[_models.BareMetalMachine]: + """Patch properties of the provided bare metal machine, or update tags associated with the bare + metal machine. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_power_off_parameters: The request body. Is one of the following - types: BareMetalMachinePowerOffParameters, JSON, IO[bytes] Default value is None. - :type bare_metal_machine_power_off_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters or JSON or IO[bytes] - :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :param bare_metal_machine_update_parameters: The request body. Is one of the following types: + BareMetalMachinePatchParameters, JSON, IO[bytes] Default value is None. + :type bare_metal_machine_update_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachinePatchParameters or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns BareMetalMachine. The BareMetalMachine is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.BareMetalMachine] :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)) - content_type = content_type if bare_metal_machine_power_off_parameters else None - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + content_type = content_type if bare_metal_machine_update_parameters else None + cls: ClsType[_models.BareMetalMachine] = 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._power_off_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_power_off_parameters=bare_metal_machine_power_off_parameters, + bare_metal_machine_update_parameters=bare_metal_machine_update_parameters, + etag=etag, + match_condition=match_condition, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -6138,14 +6908,10 @@ def begin_power_off( 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.OperationStatusResult, response.json()) + deserialized = _deserialize(_models.BareMetalMachine, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -6161,18 +6927,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.OperationStatusResult].from_continuation_token( + return LROPoller[_models.BareMetalMachine].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.OperationStatusResult]( + return LROPoller[_models.BareMetalMachine]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _reimage_initial( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + def _delete_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6180,6 +6952,12 @@ def _reimage_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -6187,10 +6965,12 @@ def _reimage_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_reimage_request( + _request = build_bare_metal_machines_delete_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6208,7 +6988,7 @@ def _reimage_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -6221,8 +7001,8 @@ def _reimage_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -6232,16 +7012,28 @@ def _reimage_initial( return deserialized # type: ignore @distributed_trace - def begin_reimage( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + def begin_delete( + self, + resource_group_name: str, + bare_metal_machine_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Reimage the provided bare metal machine. + """Delete the provided bare metal machine. All customer initiated requests will be rejected as the + life cycle of this resource is managed by the system. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] @@ -6255,9 +7047,11 @@ def begin_reimage( 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._reimage_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, + etag=etag, + match_condition=match_condition, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -6270,7 +7064,6 @@ 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.OperationStatusResult, response.json()) if cls: @@ -6300,41 +7093,247 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _replace_initial( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[ - Union[_models.BareMetalMachineReplaceParameters, JSON, IO[bytes]] - ] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.BareMetalMachine"]: + """Get a list of bare metal machines in the provided resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of BareMetalMachine + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.BareMetalMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.BareMetalMachine]] = 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_bare_metal_machines_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + 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.BareMetalMachine], + 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, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.BareMetalMachine"]: + """Get a list of bare metal machines in the provided subscription. + + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of BareMetalMachine + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.BareMetalMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.BareMetalMachine]] = 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_bare_metal_machines_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + 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.BareMetalMachine], + 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 _cordon_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_cordon_parameters: Optional[ + Union[_models.BareMetalMachineCordonParameters, JSON, IO[bytes]] + ] = None, + **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)) - content_type = content_type if bare_metal_machine_replace_parameters else None + content_type = content_type if bare_metal_machine_cordon_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if bare_metal_machine_replace_parameters else None + content_type = content_type or "application/json" if bare_metal_machine_cordon_parameters else None _content = None - if isinstance(bare_metal_machine_replace_parameters, (IOBase, bytes)): - _content = bare_metal_machine_replace_parameters + if isinstance(bare_metal_machine_cordon_parameters, (IOBase, bytes)): + _content = bare_metal_machine_cordon_parameters else: - if bare_metal_machine_replace_parameters is not None: - _content = json.dumps(bare_metal_machine_replace_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if bare_metal_machine_cordon_parameters is not None: + _content = json.dumps(bare_metal_machine_cordon_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_bare_metal_machines_replace_request( + _request = build_bare_metal_machines_cordon_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, @@ -6381,25 +7380,25 @@ def _replace_initial( return deserialized # type: ignore @overload - def begin_replace( + def begin_cordon( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[_models.BareMetalMachineReplaceParameters] = None, + bare_metal_machine_cordon_parameters: Optional[_models.BareMetalMachineCordonParameters] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Replace the provided bare metal machine. + """Cordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_replace_parameters: The request body. Default value is None. - :type bare_metal_machine_replace_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters + :param bare_metal_machine_cordon_parameters: The request body. Default value is None. + :type bare_metal_machine_cordon_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineCordonParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6410,24 +7409,24 @@ def begin_replace( """ @overload - def begin_replace( + def begin_cordon( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[JSON] = None, + bare_metal_machine_cordon_parameters: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Replace the provided bare metal machine. + """Cordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_replace_parameters: The request body. Default value is None. - :type bare_metal_machine_replace_parameters: JSON + :param bare_metal_machine_cordon_parameters: The request body. Default value is None. + :type bare_metal_machine_cordon_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6438,24 +7437,24 @@ def begin_replace( """ @overload - def begin_replace( + def begin_cordon( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[IO[bytes]] = None, + bare_metal_machine_cordon_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Replace the provided bare metal machine. + """Cordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_replace_parameters: The request body. Default value is None. - :type bare_metal_machine_replace_parameters: IO[bytes] + :param bare_metal_machine_cordon_parameters: The request body. Default value is None. + :type bare_metal_machine_cordon_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 @@ -6466,26 +7465,26 @@ def begin_replace( """ @distributed_trace - def begin_replace( + def begin_cordon( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_replace_parameters: Optional[ - Union[_models.BareMetalMachineReplaceParameters, JSON, IO[bytes]] + bare_metal_machine_cordon_parameters: Optional[ + Union[_models.BareMetalMachineCordonParameters, JSON, IO[bytes]] ] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Replace the provided bare metal machine. + """Cordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_replace_parameters: The request body. Is one of the following types: - BareMetalMachineReplaceParameters, JSON, IO[bytes] Default value is None. - :type bare_metal_machine_replace_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters or JSON or IO[bytes] + :param bare_metal_machine_cordon_parameters: The request body. Is one of the following types: + BareMetalMachineCordonParameters, JSON, IO[bytes] Default value is None. + :type bare_metal_machine_cordon_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineCordonParameters or JSON or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] @@ -6495,16 +7494,16 @@ def begin_replace( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if bare_metal_machine_replace_parameters else None + content_type = content_type if bare_metal_machine_cordon_parameters else None cls: ClsType[_models.OperationStatusResult] = 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._replace_initial( + raw_result = self._cordon_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_replace_parameters=bare_metal_machine_replace_parameters, + bare_metal_machine_cordon_parameters=bare_metal_machine_cordon_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -6548,8 +7547,14 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _restart_initial( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + def _power_off_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[ + Union[_models.BareMetalMachinePowerOffParameters, JSON, IO[bytes]] + ] = None, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6559,16 +7564,30 @@ def _restart_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)) + content_type = content_type if bare_metal_machine_power_off_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_restart_request( + content_type = content_type or "application/json" if bare_metal_machine_power_off_parameters else None + _content = None + if isinstance(bare_metal_machine_power_off_parameters, (IOBase, bytes)): + _content = bare_metal_machine_power_off_parameters + else: + if bare_metal_machine_power_off_parameters is not None: + _content = json.dumps(bare_metal_machine_power_off_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_bare_metal_machines_power_off_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -6608,33 +7627,132 @@ def _restart_initial( return deserialized # type: ignore + @overload + def begin_power_off( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[_models.BareMetalMachinePowerOffParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Power off the provided bare metal machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_power_off_parameters: The request body. Default value is None. + :type bare_metal_machine_power_off_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters + :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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_power_off( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Power off the provided bare metal machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_power_off_parameters: The request body. Default value is None. + :type bare_metal_machine_power_off_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_power_off( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Power off the provided bare metal machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_power_off_parameters: The request body. Default value is None. + :type bare_metal_machine_power_off_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def begin_restart( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + def begin_power_off( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_power_off_parameters: Optional[ + Union[_models.BareMetalMachinePowerOffParameters, JSON, IO[bytes]] + ] = None, + **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Restart the provided bare metal machine. + """Power off the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str + :param bare_metal_machine_power_off_parameters: The request body. Is one of the following + types: BareMetalMachinePowerOffParameters, JSON, IO[bytes] Default value is None. + :type bare_metal_machine_power_off_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachinePowerOffParameters or JSON or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ - _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)) + content_type = content_type if bare_metal_machine_power_off_parameters else None cls: ClsType[_models.OperationStatusResult] = 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._restart_initial( + raw_result = self._power_off_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, + bare_metal_machine_power_off_parameters=bare_metal_machine_power_off_parameters, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -6677,11 +7795,24 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _run_command_initial( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "bare_metal_machine_name", + "content_type", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + def _reimage_initial( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: Union[_models.BareMetalMachineRunCommandParameters, JSON, IO[bytes]], + body: Optional[Union[_models.BareMetalMachineReimageParameters, JSON, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -6696,16 +7827,20 @@ def _run_command_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if body else None _content = None - if isinstance(bare_metal_machine_run_command_parameters, (IOBase, bytes)): - _content = bare_metal_machine_run_command_parameters + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(bare_metal_machine_run_command_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if body is not None: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_bare_metal_machines_run_command_request( + _request = build_bare_metal_machines_reimage_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, @@ -6752,27 +7887,24 @@ def _run_command_initial( return deserialized # type: ignore @overload - def begin_run_command( + def begin_reimage( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: _models.BareMetalMachineRunCommandParameters, + body: Optional[_models.BareMetalMachineReimageParameters] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run the command or the script on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Reimage the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_command_parameters: The request body. Required. - :type bare_metal_machine_run_command_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters + :param body: The content of the action request. Default value is None. + :type body: ~azure.mgmt.networkcloud.models.BareMetalMachineReimageParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -6783,26 +7915,24 @@ def begin_run_command( """ @overload - def begin_run_command( + def begin_reimage( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: JSON, + body: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run the command or the script on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Reimage the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_command_parameters: The request body. Required. - :type bare_metal_machine_run_command_parameters: JSON + :param body: The content of the action request. Default value is None. + :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 @@ -6813,26 +7943,24 @@ def begin_run_command( """ @overload - def begin_run_command( + def begin_reimage( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: IO[bytes], + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run the command or the script on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Reimage the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_command_parameters: The request body. Required. - :type bare_metal_machine_run_command_parameters: IO[bytes] + :param body: The content of the action request. Default value is None. + :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 @@ -6843,26 +7971,37 @@ def begin_run_command( """ @distributed_trace - def begin_run_command( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "bare_metal_machine_name", + "content_type", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + def begin_reimage( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_command_parameters: Union[_models.BareMetalMachineRunCommandParameters, JSON, IO[bytes]], + body: Optional[Union[_models.BareMetalMachineReimageParameters, JSON, IO[bytes]]] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run the command or the script on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Reimage the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_command_parameters: The request body. Is one of the following - types: BareMetalMachineRunCommandParameters, JSON, IO[bytes] Required. - :type bare_metal_machine_run_command_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters or JSON or IO[bytes] + :param body: The content of the action request. Is one of the following types: + BareMetalMachineReimageParameters, JSON, IO[bytes] Default value is None. + :type body: ~azure.mgmt.networkcloud.models.BareMetalMachineReimageParameters or JSON or + IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] @@ -6872,15 +8011,16 @@ def begin_run_command( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if body else None cls: ClsType[_models.OperationStatusResult] = 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._run_command_initial( + raw_result = self._reimage_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_run_command_parameters=bare_metal_machine_run_command_parameters, + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -6924,13 +8064,13 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _run_data_extracts_initial( + def _replace_initial( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: Union[ - _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] - ], + bare_metal_machine_replace_parameters: Optional[ + Union[_models.BareMetalMachineReplaceParameters, JSON, IO[bytes]] + ] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -6945,16 +8085,20 @@ def _run_data_extracts_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if bare_metal_machine_replace_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if bare_metal_machine_replace_parameters else None _content = None - if isinstance(bare_metal_machine_run_data_extracts_parameters, (IOBase, bytes)): - _content = bare_metal_machine_run_data_extracts_parameters + if isinstance(bare_metal_machine_replace_parameters, (IOBase, bytes)): + _content = bare_metal_machine_replace_parameters else: - _content = json.dumps(bare_metal_machine_run_data_extracts_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if bare_metal_machine_replace_parameters is not None: + _content = json.dumps(bare_metal_machine_replace_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_bare_metal_machines_run_data_extracts_request( + _request = build_bare_metal_machines_replace_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, @@ -7001,27 +8145,25 @@ def _run_data_extracts_initial( return deserialized # type: ignore @overload - def begin_run_data_extracts( + def begin_replace( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: _models.BareMetalMachineRunDataExtractsParameters, + bare_metal_machine_replace_parameters: Optional[_models.BareMetalMachineReplaceParameters] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more data extractions on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Replace the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters + :param bare_metal_machine_replace_parameters: The request body. Default value is None. + :type bare_metal_machine_replace_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7032,26 +8174,24 @@ def begin_run_data_extracts( """ @overload - def begin_run_data_extracts( + def begin_replace( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: JSON, + bare_metal_machine_replace_parameters: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more data extractions on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Replace the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_parameters: JSON + :param bare_metal_machine_replace_parameters: The request body. Default value is None. + :type bare_metal_machine_replace_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7062,26 +8202,24 @@ def begin_run_data_extracts( """ @overload - def begin_run_data_extracts( + def begin_replace( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: IO[bytes], + bare_metal_machine_replace_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more data extractions on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Replace the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_parameters: IO[bytes] + :param bare_metal_machine_replace_parameters: The request body. Default value is None. + :type bare_metal_machine_replace_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 @@ -7092,28 +8230,26 @@ def begin_run_data_extracts( """ @distributed_trace - def begin_run_data_extracts( + def begin_replace( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_parameters: Union[ - _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] - ], + bare_metal_machine_replace_parameters: Optional[ + Union[_models.BareMetalMachineReplaceParameters, JSON, IO[bytes]] + ] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more data extractions on the provided bare metal machine. The URL to storage account - with the command execution results and the command exit code can be retrieved from the - operation status API once available. + """Replace the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_parameters: The request body. Is one of the - following types: BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] Required. - :type bare_metal_machine_run_data_extracts_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters or JSON or IO[bytes] + :param bare_metal_machine_replace_parameters: The request body. Is one of the following types: + BareMetalMachineReplaceParameters, JSON, IO[bytes] Default value is None. + :type bare_metal_machine_replace_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineReplaceParameters or JSON or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] @@ -7123,15 +8259,16 @@ def begin_run_data_extracts( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if bare_metal_machine_replace_parameters else None cls: ClsType[_models.OperationStatusResult] = 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._run_data_extracts_initial( + raw_result = self._replace_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_run_data_extracts_parameters=bare_metal_machine_run_data_extracts_parameters, + bare_metal_machine_replace_parameters=bare_metal_machine_replace_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7175,14 +8312,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _run_data_extracts_restricted_initial( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: Union[ - _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] - ], - **kwargs: Any + def _restart_initial( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7192,26 +8323,16 @@ def _run_data_extracts_restricted_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(bare_metal_machine_run_data_extracts_restricted_parameters, (IOBase, bytes)): - _content = bare_metal_machine_run_data_extracts_restricted_parameters - else: - _content = json.dumps(bare_metal_machine_run_data_extracts_restricted_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_bare_metal_machines_run_data_extracts_restricted_request( + _request = build_bare_metal_machines_restart_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7251,139 +8372,33 @@ def _run_data_extracts_restricted_initial( return deserialized # type: ignore - @overload - def begin_run_data_extracts_restricted( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: _models.BareMetalMachineRunDataExtractsParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more restricted data extractions on the provided bare metal machine. The URL to - storage account with the command execution results and the command exit code can be retrieved - from the operation status API once available. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_restricted_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters - :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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_run_data_extracts_restricted( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more restricted data extractions on the provided bare metal machine. The URL to - storage account with the command execution results and the command exit code can be retrieved - from the operation status API once available. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_restricted_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_run_data_extracts_restricted( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more restricted data extractions on the provided bare metal machine. The URL to - storage account with the command execution results and the command exit code can be retrieved - from the operation status API once available. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param bare_metal_machine_name: The name of the bare metal machine. Required. - :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. - :type bare_metal_machine_run_data_extracts_restricted_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def begin_run_data_extracts_restricted( - self, - resource_group_name: str, - bare_metal_machine_name: str, - bare_metal_machine_run_data_extracts_restricted_parameters: Union[ - _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] - ], - **kwargs: Any + def begin_restart( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more restricted data extractions on the provided bare metal machine. The URL to - storage account with the command execution results and the command exit code can be retrieved - from the operation status API once available. + """Restart the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Is one of - the following types: BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] Required. - :type bare_metal_machine_run_data_extracts_restricted_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters or JSON or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :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.OperationStatusResult] = 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._run_data_extracts_restricted_initial( + raw_result = self._restart_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_run_data_extracts_restricted_parameters=bare_metal_machine_run_data_extracts_restricted_parameters, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7426,13 +8441,11 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _run_read_commands_initial( + def _run_command_initial( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: Union[ - _models.BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] - ], + bare_metal_machine_run_command_parameters: Union[_models.BareMetalMachineRunCommandParameters, JSON, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -7451,12 +8464,12 @@ def _run_read_commands_initial( content_type = content_type or "application/json" _content = None - if isinstance(bare_metal_machine_run_read_commands_parameters, (IOBase, bytes)): - _content = bare_metal_machine_run_read_commands_parameters + if isinstance(bare_metal_machine_run_command_parameters, (IOBase, bytes)): + _content = bare_metal_machine_run_command_parameters else: - _content = json.dumps(bare_metal_machine_run_read_commands_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(bare_metal_machine_run_command_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_bare_metal_machines_run_read_commands_request( + _request = build_bare_metal_machines_run_command_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, @@ -7503,17 +8516,17 @@ def _run_read_commands_initial( return deserialized # type: ignore @overload - def begin_run_read_commands( + def begin_run_command( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: _models.BareMetalMachineRunReadCommandsParameters, + bare_metal_machine_run_command_parameters: _models.BareMetalMachineRunCommandParameters, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more read-only commands on the provided bare metal machine. The URL to storage - account with the command execution results and the command exit code can be retrieved from the + """Run the command or the script on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -7521,9 +8534,9 @@ def begin_run_read_commands( :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_read_commands_parameters: The request body. Required. - :type bare_metal_machine_run_read_commands_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunReadCommandsParameters + :param bare_metal_machine_run_command_parameters: The request body. Required. + :type bare_metal_machine_run_command_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7534,17 +8547,17 @@ def begin_run_read_commands( """ @overload - def begin_run_read_commands( + def begin_run_command( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: JSON, + bare_metal_machine_run_command_parameters: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more read-only commands on the provided bare metal machine. The URL to storage - account with the command execution results and the command exit code can be retrieved from the + """Run the command or the script on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -7552,8 +8565,8 @@ def begin_run_read_commands( :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_read_commands_parameters: The request body. Required. - :type bare_metal_machine_run_read_commands_parameters: JSON + :param bare_metal_machine_run_command_parameters: The request body. Required. + :type bare_metal_machine_run_command_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -7564,17 +8577,17 @@ def begin_run_read_commands( """ @overload - def begin_run_read_commands( + def begin_run_command( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: IO[bytes], + bare_metal_machine_run_command_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more read-only commands on the provided bare metal machine. The URL to storage - account with the command execution results and the command exit code can be retrieved from the + """Run the command or the script on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -7582,8 +8595,8 @@ def begin_run_read_commands( :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_read_commands_parameters: The request body. Required. - :type bare_metal_machine_run_read_commands_parameters: IO[bytes] + :param bare_metal_machine_run_command_parameters: The request body. Required. + :type bare_metal_machine_run_command_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 @@ -7594,17 +8607,15 @@ def begin_run_read_commands( """ @distributed_trace - def begin_run_read_commands( + def begin_run_command( self, resource_group_name: str, bare_metal_machine_name: str, - bare_metal_machine_run_read_commands_parameters: Union[ - _models.BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] - ], + bare_metal_machine_run_command_parameters: Union[_models.BareMetalMachineRunCommandParameters, JSON, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Run one or more read-only commands on the provided bare metal machine. The URL to storage - account with the command execution results and the command exit code can be retrieved from the + """Run the command or the script on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -7612,10 +8623,10 @@ def begin_run_read_commands( :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str - :param bare_metal_machine_run_read_commands_parameters: The request body. Is one of the - following types: BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] Required. - :type bare_metal_machine_run_read_commands_parameters: - ~azure.mgmt.networkcloud.models.BareMetalMachineRunReadCommandsParameters or JSON or IO[bytes] + :param bare_metal_machine_run_command_parameters: The request body. Is one of the following + types: BareMetalMachineRunCommandParameters, JSON, IO[bytes] Required. + :type bare_metal_machine_run_command_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunCommandParameters or JSON or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] @@ -7630,10 +8641,10 @@ def begin_run_read_commands( 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._run_read_commands_initial( + raw_result = self._run_command_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, - bare_metal_machine_run_read_commands_parameters=bare_metal_machine_run_read_commands_parameters, + bare_metal_machine_run_command_parameters=bare_metal_machine_run_command_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7677,7 +8688,15 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _start_initial(self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any) -> Iterator[bytes]: + def _run_data_extracts_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: Union[ + _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] + ], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7686,16 +8705,26 @@ def _start_initial(self, resource_group_name: str, bare_metal_machine_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 {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_bare_metal_machines_start_request( + content_type = content_type or "application/json" + _content = None + if isinstance(bare_metal_machine_run_data_extracts_parameters, (IOBase, bytes)): + _content = bare_metal_machine_run_data_extracts_parameters + else: + _content = json.dumps(bare_metal_machine_run_data_extracts_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_bare_metal_machines_run_data_extracts_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7735,33 +8764,139 @@ def _start_initial(self, resource_group_name: str, bare_metal_machine_name: str, return deserialized # type: ignore + @overload + def begin_run_data_extracts( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: _models.BareMetalMachineRunDataExtractsParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more data extractions on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the + operation status API once available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters + :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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_data_extracts( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more data extractions on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the + operation status API once available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_data_extracts( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more data extractions on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the + operation status API once available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def begin_start( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + def begin_run_data_extracts( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_parameters: Union[ + _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] + ], + **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Start the provided bare metal machine. + """Run one or more data extractions on the provided bare metal machine. The URL to storage account + with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_parameters: The request body. Is one of the + following types: BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] Required. + :type bare_metal_machine_run_data_extracts_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters or JSON or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ - _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[_models.OperationStatusResult] = 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._start_initial( + raw_result = self._run_data_extracts_initial( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, + bare_metal_machine_run_data_extracts_parameters=bare_metal_machine_run_data_extracts_parameters, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7804,8 +8939,14 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _uncordon_initial( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + def _run_data_extracts_restricted_initial( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: Union[ + _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] + ], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7815,16 +8956,26 @@ def _uncordon_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_bare_metal_machines_uncordon_request( + content_type = content_type or "application/json" + _content = None + if isinstance(bare_metal_machine_run_data_extracts_restricted_parameters, (IOBase, bytes)): + _content = bare_metal_machine_run_data_extracts_restricted_parameters + else: + _content = json.dumps(bare_metal_machine_run_data_extracts_restricted_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_bare_metal_machines_run_data_extracts_restricted_request( resource_group_name=resource_group_name, bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7864,51 +9015,157 @@ def _uncordon_initial( return deserialized # type: ignore - @distributed_trace - def begin_uncordon( - self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + @overload + def begin_run_data_extracts_restricted( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: _models.BareMetalMachineRunDataExtractsParameters, + *, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Uncordon the provided bare metal machine's Kubernetes node. + """Run one or more restricted data extractions on the provided bare metal machine. The URL to + storage account with the command execution results and the command exit code can be retrieved + from the operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param bare_metal_machine_name: The name of the bare metal machine. Required. :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_restricted_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters + :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 OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.OperationStatusResult] = 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._uncordon_initial( - resource_group_name=resource_group_name, - bare_metal_machine_name=bare_metal_machine_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["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + @overload + def begin_run_data_extracts_restricted( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more restricted data extractions on the provided bare metal machine. The URL to + storage account with the command execution results and the command exit code can be retrieved + from the operation status API once available. - deserialized = _deserialize(_models.OperationStatusResult, 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 bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_restricted_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_data_extracts_restricted( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more restricted data extractions on the provided bare metal machine. The URL to + storage account with the command execution results and the command exit code can be retrieved + from the operation status API once available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Required. + :type bare_metal_machine_run_data_extracts_restricted_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_run_data_extracts_restricted( + self, + resource_group_name: str, + bare_metal_machine_name: str, + bare_metal_machine_run_data_extracts_restricted_parameters: Union[ + _models.BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more restricted data extractions on the provided bare metal machine. The URL to + storage account with the command execution results and the command exit code can be retrieved + from the operation status API once available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_data_extracts_restricted_parameters: The request body. Is one of + the following types: BareMetalMachineRunDataExtractsParameters, JSON, IO[bytes] Required. + :type bare_metal_machine_run_data_extracts_restricted_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunDataExtractsParameters or JSON or IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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.OperationStatusResult] = 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._run_data_extracts_restricted_initial( + resource_group_name=resource_group_name, + bare_metal_machine_name=bare_metal_machine_name, + bare_metal_machine_run_data_extracts_restricted_parameters=bare_metal_machine_run_data_extracts_restricted_parameters, + 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.OperationStatusResult, 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), @@ -7933,104 +9190,13 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - -class CloudServicesNetworksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.networkcloud.NetworkCloudMgmtClient`'s - :attr:`cloud_services_networks` 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: NetworkCloudMgmtClientConfiguration = 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, cloud_services_network_name: str, **kwargs: Any - ) -> _models.CloudServicesNetwork: - """Get properties of the provided cloud services network. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :return: CloudServicesNetwork. The CloudServicesNetwork is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.CloudServicesNetwork - :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.CloudServicesNetwork] = kwargs.pop("cls", None) - - _request = build_cloud_services_networks_get_request( - resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_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.CloudServicesNetwork, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( + def _run_read_commands_initial( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: Union[_models.CloudServicesNetwork, JSON, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: Union[ + _models.BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -8039,12 +9205,6 @@ def _create_or_update_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -8055,17 +9215,15 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(cloud_services_network_parameters, (IOBase, bytes)): - _content = cloud_services_network_parameters + if isinstance(bare_metal_machine_run_read_commands_parameters, (IOBase, bytes)): + _content = bare_metal_machine_run_read_commands_parameters else: - _content = json.dumps(cloud_services_network_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(bare_metal_machine_run_read_commands_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_cloud_services_networks_create_or_update_request( + _request = build_bare_metal_machines_run_read_commands_request( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, + bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -8085,7 +9243,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 [202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -8098,10 +9256,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") - ) + 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() @@ -8111,161 +9267,137 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_run_read_commands( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: _models.CloudServicesNetwork, + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: _models.BareMetalMachineRunReadCommandsParameters, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.CloudServicesNetwork]: - """Create a new cloud services network or update the properties of the existing cloud services - network. + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more read-only commands on the provided bare metal machine. The URL to storage + account with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_parameters: The request body. Required. - :type cloud_services_network_parameters: ~azure.mgmt.networkcloud.models.CloudServicesNetwork + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_read_commands_parameters: The request body. Required. + :type bare_metal_machine_run_read_commands_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunReadCommandsParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_run_read_commands( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: JSON, - *, + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: JSON, + *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.CloudServicesNetwork]: - """Create a new cloud services network or update the properties of the existing cloud services - network. + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more read-only commands on the provided bare metal machine. The URL to storage + account with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_parameters: The request body. Required. - :type cloud_services_network_parameters: JSON + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_read_commands_parameters: The request body. Required. + :type bare_metal_machine_run_read_commands_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_run_read_commands( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: IO[bytes], + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.CloudServicesNetwork]: - """Create a new cloud services network or update the properties of the existing cloud services - network. + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more read-only commands on the provided bare metal machine. The URL to storage + account with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_parameters: The request body. Required. - :type cloud_services_network_parameters: IO[bytes] + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_read_commands_parameters: The request body. Required. + :type bare_metal_machine_run_read_commands_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 - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def begin_run_read_commands( self, resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_parameters: Union[_models.CloudServicesNetwork, JSON, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + bare_metal_machine_name: str, + bare_metal_machine_run_read_commands_parameters: Union[ + _models.BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] + ], **kwargs: Any - ) -> LROPoller[_models.CloudServicesNetwork]: - """Create a new cloud services network or update the properties of the existing cloud services - network. + ) -> LROPoller[_models.OperationStatusResult]: + """Run one or more read-only commands on the provided bare metal machine. The URL to storage + account with the command execution results and the command exit code can be retrieved from the + operation status API once available. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_parameters: The request body. Is one of the following types: - CloudServicesNetwork, JSON, IO[bytes] Required. - :type cloud_services_network_parameters: ~azure.mgmt.networkcloud.models.CloudServicesNetwork - or JSON or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :param bare_metal_machine_run_read_commands_parameters: The request body. Is one of the + following types: BareMetalMachineRunReadCommandsParameters, JSON, IO[bytes] Required. + :type bare_metal_machine_run_read_commands_parameters: + ~azure.mgmt.networkcloud.models.BareMetalMachineRunReadCommandsParameters or JSON or IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :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.CloudServicesNetwork] = kwargs.pop("cls", None) + cls: ClsType[_models.OperationStatusResult] = 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._run_read_commands_initial( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, - cloud_services_network_parameters=cloud_services_network_parameters, - etag=etag, - match_condition=match_condition, + bare_metal_machine_name=bare_metal_machine_name, + bare_metal_machine_run_read_commands_parameters=bare_metal_machine_run_read_commands_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -8276,10 +9408,14 @@ 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.CloudServicesNetwork, response.json()) + 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.OperationStatusResult, 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 = { @@ -8295,68 +9431,35 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.CloudServicesNetwork].from_continuation_token( + return LROPoller[_models.OperationStatusResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.CloudServicesNetwork]( + return LROPoller[_models.OperationStatusResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _update_initial( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[ - Union[_models.CloudServicesNetworkPatchParameters, JSON, IO[bytes]] - ] = None, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> Iterator[bytes]: + def _start_initial(self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError 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)) - content_type = content_type if cloud_services_network_update_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if cloud_services_network_update_parameters else None - _content = None - if isinstance(cloud_services_network_update_parameters, (IOBase, bytes)): - _content = cloud_services_network_update_parameters - else: - if cloud_services_network_update_parameters is not None: - _content = json.dumps(cloud_services_network_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_cloud_services_networks_update_request( + _request = build_bare_metal_machines_start_request( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, + bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -8373,7 +9476,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -8386,11 +9489,8 @@ def _update_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["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() @@ -8399,180 +9499,50 @@ def _update_initial( return deserialized # type: ignore - @overload - def begin_update( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[_models.CloudServicesNetworkPatchParameters] = None, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> LROPoller[_models.CloudServicesNetwork]: - """Update properties of the provided cloud services network, or update the tags associated with - it. Properties and tag updates can be done independently. + @distributed_trace + def begin_start( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Start the provided bare metal machine. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_update_parameters: The request body. Default value is None. - :type cloud_services_network_update_parameters: - ~azure.mgmt.networkcloud.models.CloudServicesNetworkPatchParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def begin_update( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[JSON] = None, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> LROPoller[_models.CloudServicesNetwork]: - """Update properties of the provided cloud services network, or update the tags associated with - it. Properties and tag updates can be done independently. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_update_parameters: The request body. Default value is None. - :type cloud_services_network_update_parameters: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> LROPoller[_models.CloudServicesNetwork]: - """Update properties of the provided cloud services network, or update the tags associated with - it. Properties and tag updates can be done independently. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_update_parameters: The request body. Default value is None. - :type cloud_services_network_update_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 - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - cloud_services_network_name: str, - cloud_services_network_update_parameters: Optional[ - Union[_models.CloudServicesNetworkPatchParameters, JSON, IO[bytes]] - ] = None, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> LROPoller[_models.CloudServicesNetwork]: - """Update properties of the provided cloud services network, or update the tags associated with - it. Properties and tag updates can be done independently. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :param cloud_services_network_update_parameters: The request body. Is one of the following - types: CloudServicesNetworkPatchParameters, JSON, IO[bytes] Default value is None. - :type cloud_services_network_update_parameters: - ~azure.mgmt.networkcloud.models.CloudServicesNetworkPatchParameters or JSON or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] - :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)) - content_type = content_type if cloud_services_network_update_parameters else None - cls: ClsType[_models.CloudServicesNetwork] = 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, - cloud_services_network_name=cloud_services_network_name, - cloud_services_network_update_parameters=cloud_services_network_update_parameters, - etag=etag, - match_condition=match_condition, - 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.OperationStatusResult] = 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._start_initial( + resource_group_name=resource_group_name, + bare_metal_machine_name=bare_metal_machine_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 - deserialized = _deserialize(_models.CloudServicesNetwork, response.json()) + 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.OperationStatusResult, 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 = { @@ -8588,24 +9558,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.CloudServicesNetwork].from_continuation_token( + return LROPoller[_models.OperationStatusResult].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.CloudServicesNetwork]( + return LROPoller[_models.OperationStatusResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( - self, - resource_group_name: str, - cloud_services_network_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + def _uncordon_initial( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8613,12 +9577,6 @@ def _delete_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -8626,12 +9584,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_cloud_services_networks_delete_request( + _request = build_bare_metal_machines_uncordon_request( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, + bare_metal_machine_name=bare_metal_machine_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -8649,7 +9605,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -8662,8 +9618,8 @@ 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["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() @@ -8673,27 +9629,16 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - def begin_delete( - self, - resource_group_name: str, - cloud_services_network_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + def begin_uncordon( + self, resource_group_name: str, bare_metal_machine_name: str, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Delete the provided cloud services network. + """Uncordon the provided bare metal machine's Kubernetes node. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cloud_services_network_name: The name of the cloud services network. Required. - :type cloud_services_network_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions + :param bare_metal_machine_name: The name of the bare metal machine. Required. + :type bare_metal_machine_name: str :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] @@ -8707,11 +9652,9 @@ def begin_delete( 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( + raw_result = self._uncordon_initial( resource_group_name=resource_group_name, - cloud_services_network_name=cloud_services_network_name, - etag=etag, - match_condition=match_condition, + bare_metal_machine_name=bare_metal_machine_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -8724,6 +9667,7 @@ 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.OperationStatusResult, response.json()) if cls: @@ -8753,31 +9697,39 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + +class CloudServicesNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.networkcloud.NetworkCloudMgmtClient`'s + :attr:`cloud_services_networks` 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: NetworkCloudMgmtClientConfiguration = 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_by_resource_group( - self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.CloudServicesNetwork"]: - """Get a list of cloud services networks in the provided resource group. + def get( + self, resource_group_name: str, cloud_services_network_name: str, **kwargs: Any + ) -> _models.CloudServicesNetwork: + """Get properties of the provided cloud services network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. - Default value is None. - :paramtype top: int - :keyword skip_token: The opaque token that the server returns to indicate where to continue - listing resources from. This is used for paging through large result sets. Default value is - None. - :paramtype skip_token: str - :return: An iterator like instance of CloudServicesNetwork - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.CloudServicesNetwork] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :return: CloudServicesNetwork. The CloudServicesNetwork is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.CloudServicesNetwork :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CloudServicesNetwork]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8786,226 +9738,14 @@ def list_by_resource_group( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_cloud_services_networks_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - top=top, - skip_token=skip_token, - 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.CloudServicesNetwork] = kwargs.pop("cls", None) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CloudServicesNetwork], - 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, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.CloudServicesNetwork"]: - """Get a list of cloud services networks in the provided subscription. - - :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. - Default value is None. - :paramtype top: int - :keyword skip_token: The opaque token that the server returns to indicate where to continue - listing resources from. This is used for paging through large result sets. Default value is - None. - :paramtype skip_token: str - :return: An iterator like instance of CloudServicesNetwork - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.CloudServicesNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CloudServicesNetwork]] = 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_cloud_services_networks_list_by_subscription_request( - subscription_id=self._config.subscription_id, - top=top, - skip_token=skip_token, - 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.CloudServicesNetwork], - 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 ClusterManagersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.networkcloud.NetworkCloudMgmtClient`'s - :attr:`cluster_managers` 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: NetworkCloudMgmtClientConfiguration = 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_manager_name: str, **kwargs: Any) -> _models.ClusterManager: - """Get the properties of the provided cluster manager. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager - :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.ClusterManager] = kwargs.pop("cls", None) - - _request = build_cluster_managers_get_request( + _request = build_cloud_services_networks_get_request( resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, + cloud_services_network_name=cloud_services_network_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9040,7 +9780,7 @@ def get(self, resource_group_name: str, cluster_manager_name: str, **kwargs: Any if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ClusterManager, response.json()) + deserialized = _deserialize(_models.CloudServicesNetwork, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9050,8 +9790,8 @@ def get(self, resource_group_name: str, cluster_manager_name: str, **kwargs: Any def _create_or_update_initial( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: Union[_models.ClusterManager, JSON, IO[bytes]], + cloud_services_network_name: str, + cloud_services_network_parameters: Union[_models.CloudServicesNetwork, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -9079,14 +9819,14 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(cluster_manager_parameters, (IOBase, bytes)): - _content = cluster_manager_parameters + if isinstance(cloud_services_network_parameters, (IOBase, bytes)): + _content = cloud_services_network_parameters else: - _content = json.dumps(cluster_manager_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(cloud_services_network_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_cluster_managers_create_or_update_request( + _request = build_cloud_services_networks_create_or_update_request( resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, + cloud_services_network_name=cloud_services_network_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -9138,23 +9878,24 @@ def _create_or_update_initial( def begin_create_or_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: _models.ClusterManager, + cloud_services_network_name: str, + cloud_services_network_parameters: _models.CloudServicesNetwork, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.ClusterManager]: - """Create a new cluster manager or update properties of the cluster manager if it exists. + ) -> LROPoller[_models.CloudServicesNetwork]: + """Create a new cloud services network or update the properties of the existing cloud services + network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_parameters: The request body. Required. - :type cluster_manager_parameters: ~azure.mgmt.networkcloud.models.ClusterManager + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_parameters: The request body. Required. + :type cloud_services_network_parameters: ~azure.mgmt.networkcloud.models.CloudServicesNetwork :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9163,9 +9904,9 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns ClusterManager. The ClusterManager is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9173,23 +9914,24 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: JSON, + cloud_services_network_name: str, + cloud_services_network_parameters: JSON, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.ClusterManager]: - """Create a new cluster manager or update properties of the cluster manager if it exists. + ) -> LROPoller[_models.CloudServicesNetwork]: + """Create a new cloud services network or update the properties of the existing cloud services + network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_parameters: The request body. Required. - :type cluster_manager_parameters: JSON + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_parameters: The request body. Required. + :type cloud_services_network_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9198,9 +9940,9 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns ClusterManager. The ClusterManager is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9208,24 +9950,25 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: IO[bytes], + cloud_services_network_name: str, + cloud_services_network_parameters: IO[bytes], *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.ClusterManager]: - """Create a new cluster manager or update properties of the cluster manager if it exists. + ) -> LROPoller[_models.CloudServicesNetwork]: + """Create a new cloud services network or update the properties of the existing cloud services + network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_parameters: The request body. Required. - :type cluster_manager_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_parameters: The request body. Required. + :type cloud_services_network_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 :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is @@ -9233,9 +9976,9 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns ClusterManager. The ClusterManager is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9243,47 +9986,48 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_parameters: Union[_models.ClusterManager, JSON, IO[bytes]], + cloud_services_network_name: str, + cloud_services_network_parameters: Union[_models.CloudServicesNetwork, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.ClusterManager]: - """Create a new cluster manager or update properties of the cluster manager if it exists. + ) -> LROPoller[_models.CloudServicesNetwork]: + """Create a new cloud services network or update the properties of the existing cloud services + network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_parameters: The request body. Is one of the following types: - ClusterManager, JSON, IO[bytes] Required. - :type cluster_manager_parameters: ~azure.mgmt.networkcloud.models.ClusterManager or JSON or - IO[bytes] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_parameters: The request body. Is one of the following types: + CloudServicesNetwork, JSON, IO[bytes] Required. + :type cloud_services_network_parameters: ~azure.mgmt.networkcloud.models.CloudServicesNetwork + or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns ClusterManager. The ClusterManager is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :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.ClusterManager] = kwargs.pop("cls", None) + cls: ClsType[_models.CloudServicesNetwork] = 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_manager_name=cluster_manager_name, - cluster_manager_parameters=cluster_manager_parameters, + cloud_services_network_name=cloud_services_network_name, + cloud_services_network_parameters=cloud_services_network_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -9297,7 +10041,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.ClusterManager, response.json()) + deserialized = _deserialize(_models.CloudServicesNetwork, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -9315,39 +10059,133 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ClusterManager].from_continuation_token( + return LROPoller[_models.CloudServicesNetwork].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ClusterManager]( + return LROPoller[_models.CloudServicesNetwork]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + def _update_initial( + self, + resource_group_name: str, + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[ + Union[_models.CloudServicesNetworkPatchParameters, JSON, IO[bytes]] + ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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)) + content_type = content_type if cloud_services_network_update_parameters else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if cloud_services_network_update_parameters else None + _content = None + if isinstance(cloud_services_network_update_parameters, (IOBase, bytes)): + _content = cloud_services_network_update_parameters + else: + if cloud_services_network_update_parameters is not None: + _content = json.dumps(cloud_services_network_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_cloud_services_networks_update_request( + resource_group_name=resource_group_name, + cloud_services_network_name=cloud_services_network_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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")) + + 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 update( + def begin_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_update_parameters: Optional[_models.ClusterManagerPatchParameters] = None, + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[_models.CloudServicesNetworkPatchParameters] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.ClusterManager: - """Patch properties of the provided cluster manager, or update the tags assigned to the cluster - manager. Properties and tag updates can be done independently. + ) -> LROPoller[_models.CloudServicesNetwork]: + """Update properties of the provided cloud services network, or update the tags associated with + it. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_update_parameters: The request body. Default value is None. - :type cluster_manager_update_parameters: - ~azure.mgmt.networkcloud.models.ClusterManagerPatchParameters + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_update_parameters: The request body. Default value is None. + :type cloud_services_network_update_parameters: + ~azure.mgmt.networkcloud.models.CloudServicesNetworkPatchParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9356,33 +10194,34 @@ def update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager + :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( + def begin_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_update_parameters: Optional[JSON] = None, + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.ClusterManager: - """Patch properties of the provided cluster manager, or update the tags assigned to the cluster - manager. Properties and tag updates can be done independently. + ) -> LROPoller[_models.CloudServicesNetwork]: + """Update properties of the provided cloud services network, or update the tags associated with + it. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_update_parameters: The request body. Default value is None. - :type cluster_manager_update_parameters: JSON + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_update_parameters: The request body. Default value is None. + :type cloud_services_network_update_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -9391,33 +10230,34 @@ def update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager + :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( + def begin_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_update_parameters: Optional[IO[bytes]] = None, + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.ClusterManager: - """Patch properties of the provided cluster manager, or update the tags assigned to the cluster - manager. Properties and tag updates can be done independently. + ) -> LROPoller[_models.CloudServicesNetwork]: + """Update properties of the provided cloud services network, or update the tags associated with + it. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_update_parameters: The request body. Default value is None. - :type cluster_manager_update_parameters: IO[bytes] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_update_parameters: The request body. Default value is None. + :type cloud_services_network_update_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 @@ -9426,128 +10266,106 @@ def update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager + :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def update( + def begin_update( self, resource_group_name: str, - cluster_manager_name: str, - cluster_manager_update_parameters: Optional[ - Union[_models.ClusterManagerPatchParameters, JSON, IO[bytes]] + cloud_services_network_name: str, + cloud_services_network_update_parameters: Optional[ + Union[_models.CloudServicesNetworkPatchParameters, JSON, IO[bytes]] ] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.ClusterManager: - """Patch properties of the provided cluster manager, or update the tags assigned to the cluster - manager. Properties and tag updates can be done independently. + ) -> LROPoller[_models.CloudServicesNetwork]: + """Update properties of the provided cloud services network, or update the tags associated with + it. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str - :param cluster_manager_update_parameters: The request body. Is one of the following types: - ClusterManagerPatchParameters, JSON, IO[bytes] Default value is None. - :type cluster_manager_update_parameters: - ~azure.mgmt.networkcloud.models.ClusterManagerPatchParameters or JSON or IO[bytes] + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str + :param cloud_services_network_update_parameters: The request body. Is one of the following + types: CloudServicesNetworkPatchParameters, JSON, IO[bytes] Default value is None. + :type cloud_services_network_update_parameters: + ~azure.mgmt.networkcloud.models.CloudServicesNetworkPatchParameters or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: ClusterManager. The ClusterManager is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.ClusterManager + :return: An instance of LROPoller that returns CloudServicesNetwork. The CloudServicesNetwork + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError - 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)) - content_type = content_type if cluster_manager_update_parameters else None - cls: ClsType[_models.ClusterManager] = kwargs.pop("cls", None) + content_type = content_type if cloud_services_network_update_parameters else None + cls: ClsType[_models.CloudServicesNetwork] = 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, + cloud_services_network_name=cloud_services_network_name, + cloud_services_network_update_parameters=cloud_services_network_update_parameters, + etag=etag, + match_condition=match_condition, + 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" if cluster_manager_update_parameters else None - _content = None - if isinstance(cluster_manager_update_parameters, (IOBase, bytes)): - _content = cluster_manager_update_parameters - else: - if cluster_manager_update_parameters is not None: - _content = json.dumps(cluster_manager_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudServicesNetwork, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_cluster_managers_update_request( - resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, - subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - 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.ClusterManager, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.CloudServicesNetwork].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudServicesNetwork]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( self, resource_group_name: str, - cluster_manager_name: str, + cloud_services_network_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -9572,9 +10390,9 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_cluster_managers_delete_request( + _request = build_cloud_services_networks_delete_request( resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, + cloud_services_network_name=cloud_services_network_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -9622,19 +10440,19 @@ def _delete_initial( def begin_delete( self, resource_group_name: str, - cluster_manager_name: str, + cloud_services_network_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Delete the provided cluster manager. + """Delete the provided cloud services network. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_manager_name: The name of the cluster manager. Required. - :type cluster_manager_name: str + :param cloud_services_network_name: The name of the cloud services network. Required. + :type cloud_services_network_name: str :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -9655,7 +10473,7 @@ def begin_delete( if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - cluster_manager_name=cluster_manager_name, + cloud_services_network_name=cloud_services_network_name, etag=etag, match_condition=match_condition, cls=lambda x, y, z: x, @@ -9702,8 +10520,8 @@ def get_long_running_output(pipeline_response): @distributed_trace def list_by_resource_group( self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ClusterManager"]: - """Get a list of cluster managers in the provided resource group. + ) -> ItemPaged["_models.CloudServicesNetwork"]: + """Get a list of cloud services networks in the provided resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -9715,14 +10533,14 @@ def list_by_resource_group( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of ClusterManager - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An iterator like instance of CloudServicesNetwork + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ClusterManager]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CloudServicesNetwork]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9735,7 +10553,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_cluster_managers_list_by_resource_group_request( + _request = build_cloud_services_networks_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, top=top, @@ -9776,7 +10594,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ClusterManager], + List[_models.CloudServicesNetwork], deserialized.get("value", []), ) if cls: @@ -9807,8 +10625,8 @@ def get_next(next_link=None): @distributed_trace def list_by_subscription( self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ClusterManager"]: - """Get a list of cluster managers in the provided subscription. + ) -> ItemPaged["_models.CloudServicesNetwork"]: + """Get a list of cloud services networks in the provided subscription. :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -9817,14 +10635,14 @@ def list_by_subscription( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of ClusterManager - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.ClusterManager] + :return: An iterator like instance of CloudServicesNetwork + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.CloudServicesNetwork] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ClusterManager]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CloudServicesNetwork]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9837,7 +10655,7 @@ def list_by_subscription( def prepare_request(next_link=None): if not next_link: - _request = build_cluster_managers_list_by_subscription_request( + _request = build_cloud_services_networks_list_by_subscription_request( subscription_id=self._config.subscription_id, top=top, skip_token=skip_token, @@ -9877,7 +10695,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ClusterManager], + List[_models.CloudServicesNetwork], deserialized.get("value", []), ) if cls: @@ -9906,14 +10724,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ClustersOperations: +class ClusterManagersOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.networkcloud.NetworkCloudMgmtClient`'s - :attr:`clusters` attribute. + :attr:`cluster_managers` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -9924,16 +10742,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, **kwargs: Any) -> _models.Cluster: - """Get properties of the provided cluster. + def get(self, resource_group_name: str, cluster_manager_name: str, **kwargs: Any) -> _models.ClusterManager: + """Get the properties of the provided cluster manager. :param resource_group_name: The name of the resource group. 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.networkcloud.models.Cluster + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9947,11 +10765,11 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + cls: ClsType[_models.ClusterManager] = kwargs.pop("cls", None) - _request = build_clusters_get_request( + _request = build_cluster_managers_get_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9986,7 +10804,7 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Cluster, response.json()) + deserialized = _deserialize(_models.ClusterManager, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -9996,8 +10814,8 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo def _create_or_update_initial( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: Union[_models.Cluster, JSON, IO[bytes]], + cluster_manager_name: str, + cluster_manager_parameters: Union[_models.ClusterManager, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -10025,14 +10843,14 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(cluster_parameters, (IOBase, bytes)): - _content = cluster_parameters + if isinstance(cluster_manager_parameters, (IOBase, bytes)): + _content = cluster_manager_parameters else: - _content = json.dumps(cluster_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(cluster_manager_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_clusters_create_or_update_request( + _request = build_cluster_managers_create_or_update_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -10084,23 +10902,23 @@ def _create_or_update_initial( def begin_create_or_update( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: _models.Cluster, + cluster_manager_name: str, + cluster_manager_parameters: _models.ClusterManager, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Create a new cluster or update the properties of the cluster if it exists. + ) -> LROPoller[_models.ClusterManager]: + """Create a new cluster manager or update properties of the cluster manager if it exists. :param resource_group_name: The name of the resource group. 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_parameters: The request body. Required. - :type cluster_parameters: ~azure.mgmt.networkcloud.models.Cluster + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_parameters: The request body. Required. + :type cluster_manager_parameters: ~azure.mgmt.networkcloud.models.ClusterManager :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10109,9 +10927,9 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: An instance of LROPoller that returns ClusterManager. The ClusterManager is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -10119,23 +10937,23 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: JSON, + cluster_manager_name: str, + cluster_manager_parameters: JSON, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Create a new cluster or update the properties of the cluster if it exists. + ) -> LROPoller[_models.ClusterManager]: + """Create a new cluster manager or update properties of the cluster manager if it exists. :param resource_group_name: The name of the resource group. 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_parameters: The request body. Required. - :type cluster_parameters: JSON + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_parameters: The request body. Required. + :type cluster_manager_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10144,9 +10962,9 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: An instance of LROPoller that returns ClusterManager. The ClusterManager is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -10154,23 +10972,23 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: IO[bytes], + cluster_manager_name: str, + cluster_manager_parameters: IO[bytes], *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Create a new cluster or update the properties of the cluster if it exists. + ) -> LROPoller[_models.ClusterManager]: + """Create a new cluster manager or update properties of the cluster manager if it exists. :param resource_group_name: The name of the resource group. 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_parameters: The request body. Required. - :type cluster_parameters: IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_parameters: The request body. Required. + :type cluster_manager_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 @@ -10179,9 +10997,9 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: An instance of LROPoller that returns ClusterManager. The ClusterManager is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -10189,46 +11007,47 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - cluster_name: str, - cluster_parameters: Union[_models.Cluster, JSON, IO[bytes]], + cluster_manager_name: str, + cluster_manager_parameters: Union[_models.ClusterManager, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Create a new cluster or update the properties of the cluster if it exists. + ) -> LROPoller[_models.ClusterManager]: + """Create a new cluster manager or update properties of the cluster manager if it exists. :param resource_group_name: The name of the resource group. 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_parameters: The request body. Is one of the following types: Cluster, JSON, - IO[bytes] Required. - :type cluster_parameters: ~azure.mgmt.networkcloud.models.Cluster or JSON or IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_parameters: The request body. Is one of the following types: + ClusterManager, JSON, IO[bytes] Required. + :type cluster_manager_parameters: ~azure.mgmt.networkcloud.models.ClusterManager or JSON or + IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: An instance of LROPoller that returns ClusterManager. The ClusterManager is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.ClusterManager] :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) + cls: ClsType[_models.ClusterManager] = 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, - cluster_parameters=cluster_parameters, + cluster_manager_name=cluster_manager_name, + cluster_manager_parameters=cluster_manager_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -10242,7 +11061,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Cluster, response.json()) + deserialized = _deserialize(_models.ClusterManager, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -10260,130 +11079,39 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( + return LROPoller[_models.ClusterManager].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Cluster]( + return LROPoller[_models.ClusterManager]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[Union[_models.ClusterPatchParameters, JSON, IO[bytes]]] = None, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError - 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)) - content_type = content_type if cluster_update_parameters else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if cluster_update_parameters else None - _content = None - if isinstance(cluster_update_parameters, (IOBase, bytes)): - _content = cluster_update_parameters - else: - if cluster_update_parameters is not None: - _content = json.dumps(cluster_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_clusters_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - 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")) - - 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( + def update( self, resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[_models.ClusterPatchParameters] = None, + cluster_manager_name: str, + cluster_manager_update_parameters: Optional[_models.ClusterManagerPatchParameters] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Patch the properties of the provided cluster, or update the tags associated with the cluster. - Properties and tag updates can be done independently. + ) -> _models.ClusterManager: + """Patch properties of the provided cluster manager, or update the tags assigned to the cluster + manager. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_update_parameters: The request body. Default value is None. - :type cluster_update_parameters: ~azure.mgmt.networkcloud.models.ClusterPatchParameters + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_parameters: The request body. Default value is None. + :type cluster_manager_update_parameters: + ~azure.mgmt.networkcloud.models.ClusterManagerPatchParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10392,34 +11120,33 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def update( self, resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[JSON] = None, + cluster_manager_name: str, + cluster_manager_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Patch the properties of the provided cluster, or update the tags associated with the cluster. - Properties and tag updates can be done independently. + ) -> _models.ClusterManager: + """Patch properties of the provided cluster manager, or update the tags assigned to the cluster + manager. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_update_parameters: The request body. Default value is None. - :type cluster_update_parameters: JSON + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_parameters: The request body. Default value is None. + :type cluster_manager_update_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -10428,34 +11155,33 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def update( self, resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[IO[bytes]] = None, + cluster_manager_name: str, + cluster_manager_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Patch the properties of the provided cluster, or update the tags associated with the cluster. - Properties and tag updates can be done independently. + ) -> _models.ClusterManager: + """Patch properties of the provided cluster manager, or update the tags assigned to the cluster + manager. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_update_parameters: The request body. Default value is None. - :type cluster_update_parameters: IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_parameters: The request body. Default value is None. + :type cluster_manager_update_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 @@ -10464,104 +11190,128 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + def update( self, resource_group_name: str, - cluster_name: str, - cluster_update_parameters: Optional[Union[_models.ClusterPatchParameters, JSON, IO[bytes]]] = None, + cluster_manager_name: str, + cluster_manager_update_parameters: Optional[ + Union[_models.ClusterManagerPatchParameters, JSON, IO[bytes]] + ] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Patch the properties of the provided cluster, or update the tags associated with the cluster. - Properties and tag updates can be done independently. + ) -> _models.ClusterManager: + """Patch properties of the provided cluster manager, or update the tags assigned to the cluster + manager. Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_update_parameters: The request body. Is one of the following types: - ClusterPatchParameters, JSON, IO[bytes] Default value is None. - :type cluster_update_parameters: ~azure.mgmt.networkcloud.models.ClusterPatchParameters or JSON - or IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_parameters: The request body. Is one of the following types: + ClusterManagerPatchParameters, JSON, IO[bytes] Default value is None. + :type cluster_manager_update_parameters: + ~azure.mgmt.networkcloud.models.ClusterManagerPatchParameters or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] + :return: ClusterManager. The ClusterManager is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.ClusterManager :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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)) - content_type = content_type if cluster_update_parameters else 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_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_update_parameters=cluster_update_parameters, - etag=etag, - match_condition=match_condition, - 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 if cluster_manager_update_parameters else None + cls: ClsType[_models.ClusterManager] = kwargs.pop("cls", 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 + content_type = content_type or "application/json" if cluster_manager_update_parameters else None + _content = None + if isinstance(cluster_manager_update_parameters, (IOBase, bytes)): + _content = cluster_manager_update_parameters + else: + if cluster_manager_update_parameters is not None: + _content = json.dumps(cluster_manager_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + _request = build_cluster_managers_update_request( + resource_group_name=resource_group_name, + cluster_manager_name=cluster_manager_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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.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 - ) + deserialized = _deserialize(_models.ClusterManager, 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, + cluster_manager_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -10586,9 +11336,9 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_clusters_delete_request( + _request = build_cluster_managers_delete_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -10636,19 +11386,19 @@ def _delete_initial( def begin_delete( self, resource_group_name: str, - cluster_name: str, + cluster_manager_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Delete the provided cluster. + """Delete the provided cluster manager. :param resource_group_name: The name of the resource group. 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_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -10669,7 +11419,7 @@ def begin_delete( if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, etag=etag, match_condition=match_condition, cls=lambda x, y, z: x, @@ -10716,8 +11466,8 @@ def get_long_running_output(pipeline_response): @distributed_trace def list_by_resource_group( self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.Cluster"]: - """Get a list of clusters in the provided resource group. + ) -> ItemPaged["_models.ClusterManager"]: + """Get a list of cluster managers in the provided resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -10729,14 +11479,14 @@ def list_by_resource_group( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of Cluster - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.Cluster] + :return: An iterator like instance of ClusterManager + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ClusterManager]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10749,7 +11499,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_clusters_list_by_resource_group_request( + _request = build_cluster_managers_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, top=top, @@ -10790,7 +11540,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Cluster], + List[_models.ClusterManager], deserialized.get("value", []), ) if cls: @@ -10821,8 +11571,8 @@ def get_next(next_link=None): @distributed_trace def list_by_subscription( self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.Cluster"]: - """Get a list of clusters in the provided subscription. + ) -> ItemPaged["_models.ClusterManager"]: + """Get a list of cluster managers in the provided subscription. :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -10831,14 +11581,14 @@ def list_by_subscription( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of Cluster - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.Cluster] + :return: An iterator like instance of ClusterManager + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.ClusterManager] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ClusterManager]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10851,7 +11601,7 @@ def list_by_subscription( def prepare_request(next_link=None): if not next_link: - _request = build_clusters_list_by_subscription_request( + _request = build_cluster_managers_list_by_subscription_request( subscription_id=self._config.subscription_id, top=top, skip_token=skip_token, @@ -10891,7 +11641,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Cluster], + List[_models.ClusterManager], deserialized.get("value", []), ) if cls: @@ -10919,13 +11669,26 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - def _continue_update_version_initial( + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_manager_name", + "content_type", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + def _update_relay_private_endpoint_connection_initial( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: Union[ - _models.ClusterContinueUpdateVersionParameters, JSON, IO[bytes] - ], + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[ + Union[_models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters, JSON, IO[bytes]] + ] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -10940,18 +11703,26 @@ def _continue_update_version_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if cluster_manager_update_relay_private_endpoint_connection_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = ( + content_type or "application/json" + if cluster_manager_update_relay_private_endpoint_connection_parameters + else None + ) _content = None - if isinstance(cluster_continue_update_version_parameters, (IOBase, bytes)): - _content = cluster_continue_update_version_parameters + if isinstance(cluster_manager_update_relay_private_endpoint_connection_parameters, (IOBase, bytes)): + _content = cluster_manager_update_relay_private_endpoint_connection_parameters else: - _content = json.dumps(cluster_continue_update_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if cluster_manager_update_relay_private_endpoint_connection_parameters is not None: + _content = json.dumps(cluster_manager_update_relay_private_endpoint_connection_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_clusters_continue_update_version_request( + _request = build_cluster_managers_update_relay_private_endpoint_connection_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + cluster_manager_name=cluster_manager_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -10996,26 +11767,30 @@ def _continue_update_version_initial( return deserialized # type: ignore @overload - def begin_continue_update_version( + def begin_update_relay_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: _models.ClusterContinueUpdateVersionParameters, + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[ + _models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters + ] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Trigger the continuation of an update for a cluster with a matching update strategy that has - paused after completing a segment of the update. + """Update the private endpoint connection for the Azure Relay namespace managed by the specified + cluster manager. Use this operation to approve or reject a pending private endpoint connection + request for the relay namespace managed by the cluster manager. :param resource_group_name: The name of the resource group. 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_continue_update_version_parameters: The request body. Required. - :type cluster_continue_update_version_parameters: - ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_relay_private_endpoint_connection_parameters: The request body. + Default value is None. + :type cluster_manager_update_relay_private_endpoint_connection_parameters: + ~azure.mgmt.networkcloud.models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11026,25 +11801,27 @@ def begin_continue_update_version( """ @overload - def begin_continue_update_version( + def begin_update_relay_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: JSON, + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[JSON] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Trigger the continuation of an update for a cluster with a matching update strategy that has - paused after completing a segment of the update. + """Update the private endpoint connection for the Azure Relay namespace managed by the specified + cluster manager. Use this operation to approve or reject a pending private endpoint connection + request for the relay namespace managed by the cluster manager. :param resource_group_name: The name of the resource group. 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_continue_update_version_parameters: The request body. Required. - :type cluster_continue_update_version_parameters: JSON + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_relay_private_endpoint_connection_parameters: The request body. + Default value is None. + :type cluster_manager_update_relay_private_endpoint_connection_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11055,25 +11832,27 @@ def begin_continue_update_version( """ @overload - def begin_continue_update_version( + def begin_update_relay_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: IO[bytes], + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Trigger the continuation of an update for a cluster with a matching update strategy that has - paused after completing a segment of the update. + """Update the private endpoint connection for the Azure Relay namespace managed by the specified + cluster manager. Use this operation to approve or reject a pending private endpoint connection + request for the relay namespace managed by the cluster manager. :param resource_group_name: The name of the resource group. 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_continue_update_version_parameters: The request body. Required. - :type cluster_continue_update_version_parameters: IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_relay_private_endpoint_connection_parameters: The request body. + Default value is None. + :type cluster_manager_update_relay_private_endpoint_connection_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 @@ -11084,27 +11863,43 @@ def begin_continue_update_version( """ @distributed_trace - def begin_continue_update_version( + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_manager_name", + "content_type", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + def begin_update_relay_private_endpoint_connection( # pylint: disable=name-too-long self, resource_group_name: str, - cluster_name: str, - cluster_continue_update_version_parameters: Union[ - _models.ClusterContinueUpdateVersionParameters, JSON, IO[bytes] - ], + cluster_manager_name: str, + cluster_manager_update_relay_private_endpoint_connection_parameters: Optional[ + Union[_models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters, JSON, IO[bytes]] + ] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Trigger the continuation of an update for a cluster with a matching update strategy that has - paused after completing a segment of the update. + """Update the private endpoint connection for the Azure Relay namespace managed by the specified + cluster manager. Use this operation to approve or reject a pending private endpoint connection + request for the relay namespace managed by the cluster manager. :param resource_group_name: The name of the resource group. 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_continue_update_version_parameters: The request body. Is one of the following - types: ClusterContinueUpdateVersionParameters, JSON, IO[bytes] Required. - :type cluster_continue_update_version_parameters: - ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters or JSON or IO[bytes] + :param cluster_manager_name: The name of the cluster manager. Required. + :type cluster_manager_name: str + :param cluster_manager_update_relay_private_endpoint_connection_parameters: The request body. + Is one of the following types: ClusterManagerUpdateRelayPrivateEndpointConnectionParameters, + JSON, IO[bytes] Default value is None. + :type cluster_manager_update_relay_private_endpoint_connection_parameters: + ~azure.mgmt.networkcloud.models.ClusterManagerUpdateRelayPrivateEndpointConnectionParameters or + JSON or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] @@ -11114,15 +11909,16 @@ def begin_continue_update_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if cluster_manager_update_relay_private_endpoint_connection_parameters else None cls: ClsType[_models.OperationStatusResult] = 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._continue_update_version_initial( + raw_result = self._update_relay_private_endpoint_connection_initial( resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_continue_update_version_parameters=cluster_continue_update_version_parameters, + cluster_manager_name=cluster_manager_name, + cluster_manager_update_relay_private_endpoint_connection_parameters=cluster_manager_update_relay_private_endpoint_connection_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11166,13 +11962,37 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _deploy_initial( - self, - resource_group_name: str, - cluster_name: str, - cluster_deploy_parameters: Optional[Union[_models.ClusterDeployParameters, JSON, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: + +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.networkcloud.NetworkCloudMgmtClient`'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: NetworkCloudMgmtClientConfiguration = 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 properties of the provided 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.networkcloud.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -11181,27 +12001,98 @@ def _deploy_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)) - content_type = content_type if cluster_deploy_parameters else None - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if cluster_deploy_parameters else None - _content = None - if isinstance(cluster_deploy_parameters, (IOBase, bytes)): - _content = cluster_deploy_parameters + _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: - if cluster_deploy_parameters is not None: - _content = json.dumps(cluster_deploy_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + deserialized = _deserialize(_models.Cluster, response.json()) - _request = build_clusters_deploy_request( + 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, + cluster_parameters: Union[_models.Cluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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(cluster_parameters, (IOBase, bytes)): + _content = cluster_parameters + else: + _content = json.dumps(cluster_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_create_or_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -11221,7 +12112,7 @@ def _deploy_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11234,8 +12125,10 @@ def _deploy_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -11245,127 +12138,156 @@ def _deploy_initial( return deserialized # type: ignore @overload - def begin_deploy( + def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - cluster_deploy_parameters: Optional[_models.ClusterDeployParameters] = None, + cluster_parameters: _models.Cluster, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Deploy the cluster using the rack configuration provided during creation. + ) -> LROPoller[_models.Cluster]: + """Create a new cluster or update the properties of the cluster if it exists. :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. - :type cluster_deploy_parameters: ~azure.mgmt.networkcloud.models.ClusterDeployParameters + :param cluster_parameters: The request body. Required. + :type cluster_parameters: ~azure.mgmt.networkcloud.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: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_deploy( + def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - cluster_deploy_parameters: Optional[JSON] = None, + cluster_parameters: JSON, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Deploy the cluster using the rack configuration provided during creation. + ) -> LROPoller[_models.Cluster]: + """Create a new cluster or update the properties of the cluster if it exists. :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. - :type cluster_deploy_parameters: JSON + :param cluster_parameters: The request body. Required. + :type cluster_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_deploy( + def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - cluster_deploy_parameters: Optional[IO[bytes]] = None, + cluster_parameters: IO[bytes], *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Deploy the cluster using the rack configuration provided during creation. + ) -> LROPoller[_models.Cluster]: + """Create a new cluster or update the properties of the cluster if it exists. :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. - :type cluster_deploy_parameters: IO[bytes] + :param cluster_parameters: The request body. Required. + :type cluster_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_deploy( + def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - cluster_deploy_parameters: Optional[Union[_models.ClusterDeployParameters, JSON, IO[bytes]]] = None, + cluster_parameters: Union[_models.Cluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Deploy the cluster using the rack configuration provided during creation. + ) -> LROPoller[_models.Cluster]: + """Create a new cluster or update the properties of the cluster if it exists. :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Is one of the following types: - ClusterDeployParameters, JSON, IO[bytes] Default value is None. - :type cluster_deploy_parameters: ~azure.mgmt.networkcloud.models.ClusterDeployParameters or - JSON or IO[bytes] - :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :param cluster_parameters: The request body. Is one of the following types: Cluster, JSON, + IO[bytes] Required. + :type cluster_parameters: ~azure.mgmt.networkcloud.models.Cluster or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.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)) - content_type = content_type if cluster_deploy_parameters else None - cls: ClsType[_models.OperationStatusResult] = 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._deploy_initial( + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - cluster_deploy_parameters=cluster_deploy_parameters, + cluster_parameters=cluster_parameters, + etag=etag, + match_condition=match_condition, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11376,14 +12298,10 @@ def begin_deploy( 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.OperationStatusResult, response.json()) + 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 path_format_arguments = { @@ -11399,21 +12317,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.OperationStatusResult].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.OperationStatusResult]( + return LROPoller[_models.Cluster]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _scan_runtime_initial( + def _update_initial( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[Union[_models.ClusterScanRuntimeParameters, JSON, IO[bytes]]] = None, + cluster_update_parameters: Optional[Union[_models.ClusterPatchParameters, JSON, IO[bytes]]] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -11422,29 +12343,37 @@ def _scan_runtime_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError 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)) - content_type = content_type if cluster_scan_runtime_parameters else None + content_type = content_type if cluster_update_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if cluster_scan_runtime_parameters else None + content_type = content_type or "application/json" if cluster_update_parameters else None _content = None - if isinstance(cluster_scan_runtime_parameters, (IOBase, bytes)): - _content = cluster_scan_runtime_parameters + if isinstance(cluster_update_parameters, (IOBase, bytes)): + _content = cluster_update_parameters else: - if cluster_scan_runtime_parameters is not None: - _content = json.dumps(cluster_scan_runtime_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if cluster_update_parameters is not None: + _content = json.dumps(cluster_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_clusters_scan_runtime_request( + _request = build_clusters_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -11464,7 +12393,7 @@ def _scan_runtime_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11477,10 +12406,13 @@ def _scan_runtime_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - 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 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")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -11488,132 +12420,162 @@ def _scan_runtime_initial( return deserialized # type: ignore @overload - def begin_scan_runtime( + def begin_update( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[_models.ClusterScanRuntimeParameters] = None, + cluster_update_parameters: Optional[_models.ClusterPatchParameters] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in - accordance with the cluster configuration. + ) -> LROPoller[_models.Cluster]: + """Patch the properties of the provided cluster, or update the tags associated with the cluster. + Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. - :type cluster_scan_runtime_parameters: - ~azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters + :param cluster_update_parameters: The request body. Default value is None. + :type cluster_update_parameters: ~azure.mgmt.networkcloud.models.ClusterPatchParameters :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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_scan_runtime( + def begin_update( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[JSON] = None, + cluster_update_parameters: Optional[JSON] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in - accordance with the cluster configuration. + ) -> LROPoller[_models.Cluster]: + """Patch the properties of the provided cluster, or update the tags associated with the cluster. + Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. - :type cluster_scan_runtime_parameters: JSON + :param cluster_update_parameters: The request body. Default value is None. + :type cluster_update_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_scan_runtime( + def begin_update( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[IO[bytes]] = None, + cluster_update_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in - accordance with the cluster configuration. + ) -> LROPoller[_models.Cluster]: + """Patch the properties of the provided cluster, or update the tags associated with the cluster. + Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. - :type cluster_scan_runtime_parameters: IO[bytes] + :param cluster_update_parameters: The request body. Default value is None. + :type cluster_update_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.Cluster] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_scan_runtime( + def begin_update( self, resource_group_name: str, cluster_name: str, - cluster_scan_runtime_parameters: Optional[Union[_models.ClusterScanRuntimeParameters, JSON, IO[bytes]]] = None, + cluster_update_parameters: Optional[Union[_models.ClusterPatchParameters, JSON, IO[bytes]]] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in - accordance with the cluster configuration. + ) -> LROPoller[_models.Cluster]: + """Patch the properties of the provided cluster, or update the tags associated with the cluster. + Properties and tag updates can be done independently. :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Is one of the following types: - ClusterScanRuntimeParameters, JSON, IO[bytes] Default value is None. - :type cluster_scan_runtime_parameters: - ~azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters or JSON or IO[bytes] - :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :param cluster_update_parameters: The request body. Is one of the following types: + ClusterPatchParameters, JSON, IO[bytes] Default value is None. + :type cluster_update_parameters: ~azure.mgmt.networkcloud.models.ClusterPatchParameters or JSON + or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.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)) - content_type = content_type if cluster_scan_runtime_parameters else None - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + content_type = content_type if cluster_update_parameters else 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._scan_runtime_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - cluster_scan_runtime_parameters=cluster_scan_runtime_parameters, + cluster_update_parameters=cluster_update_parameters, + etag=etag, + match_condition=match_condition, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11624,14 +12586,10 @@ def begin_scan_runtime( 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.OperationStatusResult, response.json()) + 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 path_format_arguments = { @@ -11647,21 +12605,2918 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.OperationStatusResult].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.OperationStatusResult]( + return LROPoller[_models.Cluster]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _update_version_initial( + def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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, + etag=etag, + match_condition=match_condition, + 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")) + + 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, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Delete the provided 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 etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = 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, + etag=etag, + match_condition=match_condition, + 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")) + + deserialized = _deserialize(_models.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Cluster"]: + """Get a list of clusters in the provided resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.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, + top=top, + skip_token=skip_token, + 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, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Cluster"]: + """Get a list of clusters in the provided subscription. + + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.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, + top=top, + skip_token=skip_token, + 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 _continue_update_version_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: Union[ + _models.ClusterContinueUpdateVersionParameters, 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(cluster_continue_update_version_parameters, (IOBase, bytes)): + _content = cluster_continue_update_version_parameters + else: + _content = json.dumps(cluster_continue_update_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_continue_update_version_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["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_continue_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: _models.ClusterContinueUpdateVersionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Trigger the continuation of an update for a cluster with a matching update strategy that has + paused after completing a segment of the 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 cluster_continue_update_version_parameters: The request body. Required. + :type cluster_continue_update_version_parameters: + ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters + :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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_continue_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Trigger the continuation of an update for a cluster with a matching update strategy that has + paused after completing a segment of the 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 cluster_continue_update_version_parameters: The request body. Required. + :type cluster_continue_update_version_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_continue_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Trigger the continuation of an update for a cluster with a matching update strategy that has + paused after completing a segment of the 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 cluster_continue_update_version_parameters: The request body. Required. + :type cluster_continue_update_version_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_continue_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_continue_update_version_parameters: Union[ + _models.ClusterContinueUpdateVersionParameters, JSON, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Trigger the continuation of an update for a cluster with a matching update strategy that has + paused after completing a segment of the 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 cluster_continue_update_version_parameters: The request body. Is one of the following + types: ClusterContinueUpdateVersionParameters, JSON, IO[bytes] Required. + :type cluster_continue_update_version_parameters: + ~azure.mgmt.networkcloud.models.ClusterContinueUpdateVersionParameters or JSON or IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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.OperationStatusResult] = 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._continue_update_version_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_continue_update_version_parameters=cluster_continue_update_version_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _deploy_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[Union[_models.ClusterDeployParameters, JSON, IO[bytes]]] = None, + **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)) + content_type = content_type if cluster_deploy_parameters else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if cluster_deploy_parameters else None + _content = None + if isinstance(cluster_deploy_parameters, (IOBase, bytes)): + _content = cluster_deploy_parameters + else: + if cluster_deploy_parameters is not None: + _content = json.dumps(cluster_deploy_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_clusters_deploy_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["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_deploy( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[_models.ClusterDeployParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Deploy the cluster using the rack configuration provided during creation. + + :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. + :type cluster_deploy_parameters: ~azure.mgmt.networkcloud.models.ClusterDeployParameters + :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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_deploy( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Deploy the cluster using the rack configuration provided during creation. + + :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. + :type cluster_deploy_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_deploy( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Deploy the cluster using the rack configuration provided during creation. + + :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Default value is None. + :type cluster_deploy_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_deploy( + self, + resource_group_name: str, + cluster_name: str, + cluster_deploy_parameters: Optional[Union[_models.ClusterDeployParameters, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Deploy the cluster using the rack configuration provided during creation. + + :param resource_group_name: The name of the resource group. 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_deploy_parameters: The request body. Is one of the following types: + ClusterDeployParameters, JSON, IO[bytes] Default value is None. + :type cluster_deploy_parameters: ~azure.mgmt.networkcloud.models.ClusterDeployParameters or + JSON or IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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)) + content_type = content_type if cluster_deploy_parameters else None + cls: ClsType[_models.OperationStatusResult] = 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._deploy_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_deploy_parameters=cluster_deploy_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "content_type", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + def _inspect_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[Union[_models.ClusterInspectParameters, JSON, IO[bytes]]] = None, + **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)) + content_type = content_type if cluster_inspect_parameters else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if cluster_inspect_parameters else None + _content = None + if isinstance(cluster_inspect_parameters, (IOBase, bytes)): + _content = cluster_inspect_parameters + else: + if cluster_inspect_parameters is not None: + _content = json.dumps(cluster_inspect_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_clusters_inspect_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["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_inspect( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[_models.ClusterInspectParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Trigger an inspection of the cluster to perform validation and optional corrective actions + based on the supplied additional actions and filters. + + :param resource_group_name: The name of the resource group. 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_inspect_parameters: The request body. Default value is None. + :type cluster_inspect_parameters: ~azure.mgmt.networkcloud.models.ClusterInspectParameters + :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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_inspect( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Trigger an inspection of the cluster to perform validation and optional corrective actions + based on the supplied additional actions and filters. + + :param resource_group_name: The name of the resource group. 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_inspect_parameters: The request body. Default value is None. + :type cluster_inspect_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_inspect( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Trigger an inspection of the cluster to perform validation and optional corrective actions + based on the supplied additional actions and filters. + + :param resource_group_name: The name of the resource group. 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_inspect_parameters: The request body. Default value is None. + :type cluster_inspect_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "content_type", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + def begin_inspect( + self, + resource_group_name: str, + cluster_name: str, + cluster_inspect_parameters: Optional[Union[_models.ClusterInspectParameters, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Trigger an inspection of the cluster to perform validation and optional corrective actions + based on the supplied additional actions and filters. + + :param resource_group_name: The name of the resource group. 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_inspect_parameters: The request body. Is one of the following types: + ClusterInspectParameters, JSON, IO[bytes] Default value is None. + :type cluster_inspect_parameters: ~azure.mgmt.networkcloud.models.ClusterInspectParameters or + JSON or IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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)) + content_type = content_type if cluster_inspect_parameters else None + cls: ClsType[_models.OperationStatusResult] = 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._inspect_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_inspect_parameters=cluster_inspect_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "content_type", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + def _rotate_credential_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.ClusterRotateCredentialParameters, 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_rotate_credential_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["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_rotate_credential( + self, + resource_group_name: str, + cluster_name: str, + body: _models.ClusterRotateCredentialParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Rotate the specified cluster credential. + + :param resource_group_name: The name of the resource group. 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.networkcloud.models.ClusterRotateCredentialParameters + :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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_rotate_credential( + self, + resource_group_name: str, + cluster_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Rotate the specified cluster credential. + + :param resource_group_name: The name of the resource group. 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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_rotate_credential( + self, + resource_group_name: str, + cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Rotate the specified cluster credential. + + :param resource_group_name: The name of the resource group. 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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "content_type", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + def begin_rotate_credential( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.ClusterRotateCredentialParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Rotate the specified cluster credential. + + :param resource_group_name: The name of the resource group. 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: + ClusterRotateCredentialParameters, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.networkcloud.models.ClusterRotateCredentialParameters or JSON or + IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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.OperationStatusResult] = 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._rotate_credential_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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _scan_runtime_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[Union[_models.ClusterScanRuntimeParameters, JSON, IO[bytes]]] = None, + **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)) + content_type = content_type if cluster_scan_runtime_parameters else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if cluster_scan_runtime_parameters else None + _content = None + if isinstance(cluster_scan_runtime_parameters, (IOBase, bytes)): + _content = cluster_scan_runtime_parameters + else: + if cluster_scan_runtime_parameters is not None: + _content = json.dumps(cluster_scan_runtime_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_clusters_scan_runtime_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["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_scan_runtime( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[_models.ClusterScanRuntimeParameters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in + accordance with the cluster configuration. + + :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. + :type cluster_scan_runtime_parameters: + ~azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters + :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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_scan_runtime( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in + accordance with the cluster configuration. + + :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. + :type cluster_scan_runtime_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_scan_runtime( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in + accordance with the cluster configuration. + + :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Default value is None. + :type cluster_scan_runtime_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_scan_runtime( + self, + resource_group_name: str, + cluster_name: str, + cluster_scan_runtime_parameters: Optional[Union[_models.ClusterScanRuntimeParameters, JSON, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Triggers the execution of a runtime protection scan to detect and remediate detected issues, in + accordance with the cluster configuration. + + :param resource_group_name: The name of the resource group. 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_scan_runtime_parameters: The request body. Is one of the following types: + ClusterScanRuntimeParameters, JSON, IO[bytes] Default value is None. + :type cluster_scan_runtime_parameters: + ~azure.mgmt.networkcloud.models.ClusterScanRuntimeParameters or JSON or IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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)) + content_type = content_type if cluster_scan_runtime_parameters else None + cls: ClsType[_models.OperationStatusResult] = 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._scan_runtime_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_scan_runtime_parameters=cluster_scan_runtime_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_version_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: Union[_models.ClusterUpdateVersionParameters, 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(cluster_update_version_parameters, (IOBase, bytes)): + _content = cluster_update_version_parameters + else: + _content = json.dumps(cluster_update_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_version_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["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_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: _models.ClusterUpdateVersionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Update the version of the provided cluster to one of the available supported versions. + + :param resource_group_name: The name of the resource group. 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_update_version_parameters: The request body. Required. + :type cluster_update_version_parameters: + ~azure.mgmt.networkcloud.models.ClusterUpdateVersionParameters + :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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Update the version of the provided cluster to one of the available supported versions. + + :param resource_group_name: The name of the resource group. 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_update_version_parameters: The request body. Required. + :type cluster_update_version_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Update the version of the provided cluster to one of the available supported versions. + + :param resource_group_name: The name of the resource group. 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_update_version_parameters: The request body. Required. + :type cluster_update_version_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 OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_version( + self, + resource_group_name: str, + cluster_name: str, + cluster_update_version_parameters: Union[_models.ClusterUpdateVersionParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Update the version of the provided cluster to one of the available supported versions. + + :param resource_group_name: The name of the resource group. 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_update_version_parameters: The request body. Is one of the following types: + ClusterUpdateVersionParameters, JSON, IO[bytes] Required. + :type cluster_update_version_parameters: + ~azure.mgmt.networkcloud.models.ClusterUpdateVersionParameters or JSON or IO[bytes] + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :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.OperationStatusResult] = 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_version_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_update_version_parameters=cluster_update_version_parameters, + 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class KubernetesClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.networkcloud.NetworkCloudMgmtClient`'s + :attr:`kubernetes_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: NetworkCloudMgmtClientConfiguration = 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, kubernetes_cluster_name: str, **kwargs: Any) -> _models.KubernetesCluster: + """Get properties of the provided the Kubernetes cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :return: KubernetesCluster. The KubernetesCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.KubernetesCluster + :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.KubernetesCluster] = kwargs.pop("cls", None) + + _request = build_kubernetes_clusters_get_request( + resource_group_name=resource_group_name, + kubernetes_cluster_name=kubernetes_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.KubernetesCluster, 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, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: Union[_models.KubernetesCluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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(kubernetes_cluster_parameters, (IOBase, bytes)): + _content = kubernetes_cluster_parameters + else: + _content = json.dumps(kubernetes_cluster_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_kubernetes_clusters_create_or_update_request( + resource_group_name=resource_group_name, + kubernetes_cluster_name=kubernetes_cluster_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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") + ) + + 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, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: _models.KubernetesCluster, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.KubernetesCluster]: + """Create a new Kubernetes cluster or update the properties of the existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_parameters: The request body. Required. + :type kubernetes_cluster_parameters: ~azure.mgmt.networkcloud.models.KubernetesCluster + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.KubernetesCluster]: + """Create a new Kubernetes cluster or update the properties of the existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_parameters: The request body. Required. + :type kubernetes_cluster_parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.KubernetesCluster]: + """Create a new Kubernetes cluster or update the properties of the existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_parameters: The request body. Required. + :type kubernetes_cluster_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 + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_parameters: Union[_models.KubernetesCluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.KubernetesCluster]: + """Create a new Kubernetes cluster or update the properties of the existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_parameters: The request body. Is one of the following types: + KubernetesCluster, JSON, IO[bytes] Required. + :type kubernetes_cluster_parameters: ~azure.mgmt.networkcloud.models.KubernetesCluster or JSON + or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :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.KubernetesCluster] = 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, + kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_cluster_parameters=kubernetes_cluster_parameters, + etag=etag, + match_condition=match_condition, + 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.KubernetesCluster, 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.KubernetesCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.KubernetesCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[ + Union[_models.KubernetesClusterPatchParameters, JSON, IO[bytes]] + ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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)) + content_type = content_type if kubernetes_cluster_update_parameters else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if kubernetes_cluster_update_parameters else None + _content = None + if isinstance(kubernetes_cluster_update_parameters, (IOBase, bytes)): + _content = kubernetes_cluster_update_parameters + else: + if kubernetes_cluster_update_parameters is not None: + _content = json.dumps(kubernetes_cluster_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_kubernetes_clusters_update_request( + resource_group_name=resource_group_name, + kubernetes_cluster_name=kubernetes_cluster_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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")) + + 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, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[_models.KubernetesClusterPatchParameters] = None, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.KubernetesCluster]: + """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the + Kubernetes cluster. Properties and tag updates can be done independently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_update_parameters: The request body. Default value is None. + :type kubernetes_cluster_update_parameters: + ~azure.mgmt.networkcloud.models.KubernetesClusterPatchParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[JSON] = None, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.KubernetesCluster]: + """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the + Kubernetes cluster. Properties and tag updates can be done independently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_update_parameters: The request body. Default value is None. + :type kubernetes_cluster_update_parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.KubernetesCluster]: + """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the + Kubernetes cluster. Properties and tag updates can be done independently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_update_parameters: The request body. Default value is None. + :type kubernetes_cluster_update_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 + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + kubernetes_cluster_update_parameters: Optional[ + Union[_models.KubernetesClusterPatchParameters, JSON, IO[bytes]] + ] = None, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.KubernetesCluster]: + """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the + Kubernetes cluster. Properties and tag updates can be done independently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_update_parameters: The request body. Is one of the following types: + KubernetesClusterPatchParameters, JSON, IO[bytes] Default value is None. + :type kubernetes_cluster_update_parameters: + ~azure.mgmt.networkcloud.models.KubernetesClusterPatchParameters or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :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)) + content_type = content_type if kubernetes_cluster_update_parameters else None + cls: ClsType[_models.KubernetesCluster] = 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, + kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_cluster_update_parameters=kubernetes_cluster_update_parameters, + etag=etag, + match_condition=match_condition, + 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.KubernetesCluster, 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.KubernetesCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.KubernetesCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + kubernetes_cluster_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + 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_kubernetes_clusters_delete_request( + resource_group_name=resource_group_name, + kubernetes_cluster_name=kubernetes_cluster_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + 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")) + + 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, + kubernetes_cluster_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.OperationStatusResult]: + """Delete the provided Kubernetes cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = 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, + kubernetes_cluster_name=kubernetes_cluster_name, + etag=etag, + match_condition=match_condition, + 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")) + + deserialized = _deserialize(_models.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OperationStatusResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.KubernetesCluster"]: + """Get a list of Kubernetes clusters in the provided resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of KubernetesCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.KubernetesCluster]] = 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_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + 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.KubernetesCluster], + 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, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.KubernetesCluster"]: + """Get a list of Kubernetes clusters in the provided subscription. + + :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :paramtype top: int + :keyword skip_token: The opaque token that the server returns to indicate where to continue + listing resources from. This is used for paging through large result sets. Default value is + None. + :paramtype skip_token: str + :return: An iterator like instance of KubernetesCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.KubernetesCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.KubernetesCluster]] = 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_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + skip_token=skip_token, + 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.KubernetesCluster], + 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 _restart_node_initial( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: Union[_models.ClusterUpdateVersionParameters, JSON, IO[bytes]], + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: Union[ + _models.KubernetesClusterRestartNodeParameters, JSON, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -11680,14 +15535,14 @@ def _update_version_initial( content_type = content_type or "application/json" _content = None - if isinstance(cluster_update_version_parameters, (IOBase, bytes)): - _content = cluster_update_version_parameters + if isinstance(kubernetes_cluster_restart_node_parameters, (IOBase, bytes)): + _content = kubernetes_cluster_restart_node_parameters else: - _content = json.dumps(cluster_update_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(kubernetes_cluster_restart_node_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_clusters_update_version_request( + _request = build_kubernetes_clusters_restart_node_request( resource_group_name=resource_group_name, - cluster_name=cluster_name, + kubernetes_cluster_name=kubernetes_cluster_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11732,25 +15587,25 @@ def _update_version_initial( return deserialized # type: ignore @overload - def begin_update_version( + def begin_restart_node( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: _models.ClusterUpdateVersionParameters, + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: _models.KubernetesClusterRestartNodeParameters, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Update the version of the provided cluster to one of the available supported versions. + """Restart a targeted node of a Kubernetes 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_update_version_parameters: The request body. Required. - :type cluster_update_version_parameters: - ~azure.mgmt.networkcloud.models.ClusterUpdateVersionParameters + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_restart_node_parameters: The request body. Required. + :type kubernetes_cluster_restart_node_parameters: + ~azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11761,24 +15616,24 @@ def begin_update_version( """ @overload - def begin_update_version( + def begin_restart_node( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: JSON, + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Update the version of the provided cluster to one of the available supported versions. + """Restart a targeted node of a Kubernetes 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_update_version_parameters: The request body. Required. - :type cluster_update_version_parameters: JSON + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_restart_node_parameters: The request body. Required. + :type kubernetes_cluster_restart_node_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -11789,24 +15644,24 @@ def begin_update_version( """ @overload - def begin_update_version( + def begin_restart_node( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: IO[bytes], + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Update the version of the provided cluster to one of the available supported versions. + """Restart a targeted node of a Kubernetes 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_update_version_parameters: The request body. Required. - :type cluster_update_version_parameters: IO[bytes] + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_restart_node_parameters: The request body. Required. + :type kubernetes_cluster_restart_node_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 @@ -11817,24 +15672,26 @@ def begin_update_version( """ @distributed_trace - def begin_update_version( + def begin_restart_node( self, resource_group_name: str, - cluster_name: str, - cluster_update_version_parameters: Union[_models.ClusterUpdateVersionParameters, JSON, IO[bytes]], + kubernetes_cluster_name: str, + kubernetes_cluster_restart_node_parameters: Union[ + _models.KubernetesClusterRestartNodeParameters, JSON, IO[bytes] + ], **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Update the version of the provided cluster to one of the available supported versions. + """Restart a targeted node of a Kubernetes 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_update_version_parameters: The request body. Is one of the following types: - ClusterUpdateVersionParameters, JSON, IO[bytes] Required. - :type cluster_update_version_parameters: - ~azure.mgmt.networkcloud.models.ClusterUpdateVersionParameters or JSON or IO[bytes] + :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. + :type kubernetes_cluster_name: str + :param kubernetes_cluster_restart_node_parameters: The request body. Is one of the following + types: KubernetesClusterRestartNodeParameters, JSON, IO[bytes] Required. + :type kubernetes_cluster_restart_node_parameters: + ~azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters or JSON or IO[bytes] :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] @@ -11849,10 +15706,10 @@ def begin_update_version( 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_version_initial( + raw_result = self._restart_node_initial( resource_group_name=resource_group_name, - cluster_name=cluster_name, - cluster_update_version_parameters=cluster_update_version_parameters, + kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_cluster_restart_node_parameters=kubernetes_cluster_restart_node_parameters, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -11897,14 +15754,14 @@ def get_long_running_output(pipeline_response): ) -class KubernetesClustersOperations: +class KubernetesVersionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.networkcloud.NetworkCloudMgmtClient`'s - :attr:`kubernetes_clusters` attribute. + :attr:`kubernetes_versions` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11915,16 +15772,30 @@ 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, kubernetes_cluster_name: str, **kwargs: Any) -> _models.KubernetesCluster: - """Get properties of the provided the Kubernetes cluster. + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) + def get(self, resource_group_name: str, kubernetes_version_name: str, **kwargs: Any) -> _models.KubernetesVersion: + """Retrieve the Kubernetes version resource that describes the available Kubernetes versions for + deployment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :return: KubernetesCluster. The KubernetesCluster is compatible with MutableMapping - :rtype: ~azure.mgmt.networkcloud.models.KubernetesCluster + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :return: KubernetesVersion. The KubernetesVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.networkcloud.models.KubernetesVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11938,11 +15809,11 @@ def get(self, resource_group_name: str, kubernetes_cluster_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.KubernetesCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.KubernetesVersion] = kwargs.pop("cls", None) - _request = build_kubernetes_clusters_get_request( + _request = build_kubernetes_versions_get_request( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11977,18 +15848,34 @@ def get(self, resource_group_name: str, kubernetes_cluster_name: str, **kwargs: if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.KubernetesCluster, response.json()) + deserialized = _deserialize(_models.KubernetesVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def _create_or_update_initial( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: Union[_models.KubernetesCluster, JSON, IO[bytes]], + kubernetes_version_name: str, + kubernetes_version_parameters: Union[_models.KubernetesVersion, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -12016,14 +15903,14 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(kubernetes_cluster_parameters, (IOBase, bytes)): - _content = kubernetes_cluster_parameters + if isinstance(kubernetes_version_parameters, (IOBase, bytes)): + _content = kubernetes_version_parameters else: - _content = json.dumps(kubernetes_cluster_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(kubernetes_version_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_kubernetes_clusters_create_or_update_request( + _request = build_kubernetes_versions_create_or_update_request( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -12075,23 +15962,24 @@ def _create_or_update_initial( def begin_create_or_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: _models.KubernetesCluster, + kubernetes_version_name: str, + kubernetes_version_parameters: _models.KubernetesVersion, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.KubernetesCluster]: - """Create a new Kubernetes cluster or update the properties of the existing one. + ) -> LROPoller[_models.KubernetesVersion]: + """Create the Kubernetes version resource or update its tags. This resource is system managed and + should only be created with the name "default". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_parameters: The request body. Required. - :type kubernetes_cluster_parameters: ~azure.mgmt.networkcloud.models.KubernetesCluster + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_parameters: The request body. Required. + :type kubernetes_version_parameters: ~azure.mgmt.networkcloud.models.KubernetesVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12100,9 +15988,9 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of LROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -12110,23 +15998,24 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: JSON, + kubernetes_version_name: str, + kubernetes_version_parameters: JSON, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.KubernetesCluster]: - """Create a new Kubernetes cluster or update the properties of the existing one. + ) -> LROPoller[_models.KubernetesVersion]: + """Create the Kubernetes version resource or update its tags. This resource is system managed and + should only be created with the name "default". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_parameters: The request body. Required. - :type kubernetes_cluster_parameters: JSON + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_parameters: The request body. Required. + :type kubernetes_version_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12135,9 +16024,9 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of LROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -12145,23 +16034,24 @@ def begin_create_or_update( def begin_create_or_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: IO[bytes], + kubernetes_version_name: str, + kubernetes_version_parameters: IO[bytes], *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.KubernetesCluster]: - """Create a new Kubernetes cluster or update the properties of the existing one. + ) -> LROPoller[_models.KubernetesVersion]: + """Create the Kubernetes version resource or update its tags. This resource is system managed and + should only be created with the name "default". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_parameters: The request body. Required. - :type kubernetes_cluster_parameters: IO[bytes] + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_parameters: The request body. Required. + :type kubernetes_version_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 @@ -12170,57 +16060,74 @@ def begin_create_or_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of LROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def begin_create_or_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_parameters: Union[_models.KubernetesCluster, JSON, IO[bytes]], + kubernetes_version_name: str, + kubernetes_version_parameters: Union[_models.KubernetesVersion, JSON, IO[bytes]], *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.KubernetesCluster]: - """Create a new Kubernetes cluster or update the properties of the existing one. + ) -> LROPoller[_models.KubernetesVersion]: + """Create the Kubernetes version resource or update its tags. This resource is system managed and + should only be created with the name "default". :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_parameters: The request body. Is one of the following types: - KubernetesCluster, JSON, IO[bytes] Required. - :type kubernetes_cluster_parameters: ~azure.mgmt.networkcloud.models.KubernetesCluster or JSON + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_parameters: The request body. Is one of the following types: + KubernetesVersion, JSON, IO[bytes] Required. + :type kubernetes_version_parameters: ~azure.mgmt.networkcloud.models.KubernetesVersion or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of LROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :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.KubernetesCluster] = kwargs.pop("cls", None) + cls: ClsType[_models.KubernetesVersion] = 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, - kubernetes_cluster_name=kubernetes_cluster_name, - kubernetes_cluster_parameters=kubernetes_cluster_parameters, + kubernetes_version_name=kubernetes_version_name, + kubernetes_version_parameters=kubernetes_version_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -12234,7 +16141,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.KubernetesCluster, response.json()) + deserialized = _deserialize(_models.KubernetesVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -12252,22 +16159,38 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.KubernetesCluster].from_continuation_token( + return LROPoller[_models.KubernetesVersion].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.KubernetesCluster]( + return LROPoller[_models.KubernetesVersion]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def _update_initial( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[ - Union[_models.KubernetesClusterPatchParameters, JSON, IO[bytes]] + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[ + Union[_models.KubernetesVersionPatchParameters, JSON, IO[bytes]] ] = None, *, etag: Optional[str] = None, @@ -12292,22 +16215,22 @@ def _update_initial( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if kubernetes_cluster_update_parameters else None + content_type = content_type if kubernetes_version_patch_parameters else None cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if kubernetes_cluster_update_parameters else None + content_type = content_type or "application/json" if kubernetes_version_patch_parameters else None _content = None - if isinstance(kubernetes_cluster_update_parameters, (IOBase, bytes)): - _content = kubernetes_cluster_update_parameters + if isinstance(kubernetes_version_patch_parameters, (IOBase, bytes)): + _content = kubernetes_version_patch_parameters else: - if kubernetes_cluster_update_parameters is not None: - _content = json.dumps(kubernetes_cluster_update_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if kubernetes_version_patch_parameters is not None: + _content = json.dumps(kubernetes_version_patch_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore else: _content = None - _request = build_kubernetes_clusters_update_request( + _request = build_kubernetes_versions_update_request( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -12360,25 +16283,25 @@ def _update_initial( def begin_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[_models.KubernetesClusterPatchParameters] = None, + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[_models.KubernetesVersionPatchParameters] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.KubernetesCluster]: - """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the - Kubernetes cluster. Properties and tag updates can be done independently. + ) -> LROPoller[_models.KubernetesVersion]: + """Update tags associated with the Kubernetes version resource. No other properties are supported + for update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_update_parameters: The request body. Default value is None. - :type kubernetes_cluster_update_parameters: - ~azure.mgmt.networkcloud.models.KubernetesClusterPatchParameters + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_patch_parameters: The request body. Default value is None. + :type kubernetes_version_patch_parameters: + ~azure.mgmt.networkcloud.models.KubernetesVersionPatchParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12387,9 +16310,9 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of LROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -12397,24 +16320,24 @@ def begin_update( def begin_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[JSON] = None, + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[JSON] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.KubernetesCluster]: - """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the - Kubernetes cluster. Properties and tag updates can be done independently. + ) -> LROPoller[_models.KubernetesVersion]: + """Update tags associated with the Kubernetes version resource. No other properties are supported + for update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_update_parameters: The request body. Default value is None. - :type kubernetes_cluster_update_parameters: JSON + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_patch_parameters: The request body. Default value is None. + :type kubernetes_version_patch_parameters: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -12423,9 +16346,9 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of LROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -12433,24 +16356,24 @@ def begin_update( def begin_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[IO[bytes]] = None, + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.KubernetesCluster]: - """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the - Kubernetes cluster. Properties and tag updates can be done independently. + ) -> LROPoller[_models.KubernetesVersion]: + """Update tags associated with the Kubernetes version resource. No other properties are supported + for update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_update_parameters: The request body. Default value is None. - :type kubernetes_cluster_update_parameters: IO[bytes] + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_patch_parameters: The request body. Default value is None. + :type kubernetes_version_patch_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 @@ -12459,61 +16382,77 @@ def begin_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of LROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def begin_update( self, resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_update_parameters: Optional[ - Union[_models.KubernetesClusterPatchParameters, JSON, IO[bytes]] + kubernetes_version_name: str, + kubernetes_version_patch_parameters: Optional[ + Union[_models.KubernetesVersionPatchParameters, JSON, IO[bytes]] ] = None, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.KubernetesCluster]: - """Patch the properties of the provided Kubernetes cluster, or update the tags associated with the - Kubernetes cluster. Properties and tag updates can be done independently. + ) -> LROPoller[_models.KubernetesVersion]: + """Update tags associated with the Kubernetes version resource. No other properties are supported + for update. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_update_parameters: The request body. Is one of the following types: - KubernetesClusterPatchParameters, JSON, IO[bytes] Default value is None. - :type kubernetes_cluster_update_parameters: - ~azure.mgmt.networkcloud.models.KubernetesClusterPatchParameters or JSON or IO[bytes] + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str + :param kubernetes_version_patch_parameters: The request body. Is one of the following types: + KubernetesVersionPatchParameters, JSON, IO[bytes] Default value is None. + :type kubernetes_version_patch_parameters: + ~azure.mgmt.networkcloud.models.KubernetesVersionPatchParameters or JSON or IO[bytes] :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns KubernetesCluster. The KubernetesCluster is + :return: An instance of LROPoller that returns KubernetesVersion. The KubernetesVersion is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesCluster] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.KubernetesVersion] :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)) - content_type = content_type if kubernetes_cluster_update_parameters else None - cls: ClsType[_models.KubernetesCluster] = kwargs.pop("cls", None) + content_type = content_type if kubernetes_version_patch_parameters else None + cls: ClsType[_models.KubernetesVersion] = 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, - kubernetes_cluster_name=kubernetes_cluster_name, - kubernetes_cluster_update_parameters=kubernetes_cluster_update_parameters, + kubernetes_version_name=kubernetes_version_name, + kubernetes_version_patch_parameters=kubernetes_version_patch_parameters, etag=etag, match_condition=match_condition, content_type=content_type, @@ -12527,7 +16466,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.KubernetesCluster, response.json()) + deserialized = _deserialize(_models.KubernetesVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -12545,20 +16484,34 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.KubernetesCluster].from_continuation_token( + return LROPoller[_models.KubernetesVersion].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.KubernetesCluster]( + return LROPoller[_models.KubernetesVersion]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def _delete_initial( self, resource_group_name: str, - kubernetes_cluster_name: str, + kubernetes_version_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, @@ -12583,9 +16536,9 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_kubernetes_clusters_delete_request( + _request = build_kubernetes_versions_delete_request( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, subscription_id=self._config.subscription_id, etag=etag, match_condition=match_condition, @@ -12630,22 +16583,36 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "kubernetes_version_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def begin_delete( self, resource_group_name: str, - kubernetes_cluster_name: str, + kubernetes_version_name: str, *, etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> LROPoller[_models.OperationStatusResult]: - """Delete the provided Kubernetes cluster. + """Delete the specified Kubernetes version resource. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str + :param kubernetes_version_name: The name of the Kubernetes version resource. Required. + :type kubernetes_version_name: str :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None. :paramtype etag: str @@ -12666,7 +16633,7 @@ def begin_delete( if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, + kubernetes_version_name=kubernetes_version_name, etag=etag, match_condition=match_condition, cls=lambda x, y, z: x, @@ -12711,10 +16678,24 @@ def get_long_running_output(pipeline_response): ) @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={ + "2026-01-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "top", + "skip_token", + "accept", + ] + }, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def list_by_resource_group( self, resource_group_name: str, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.KubernetesCluster"]: - """Get a list of Kubernetes clusters in the provided resource group. + ) -> ItemPaged["_models.KubernetesVersion"]: + """Get a list of Kubernetes version resources in the provided resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -12726,14 +16707,14 @@ def list_by_resource_group( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of KubernetesCluster - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.KubernetesCluster] + :return: An iterator like instance of KubernetesVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.KubernetesCluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.KubernetesVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12746,7 +16727,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_kubernetes_clusters_list_by_resource_group_request( + _request = build_kubernetes_versions_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, top=top, @@ -12787,7 +16768,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.KubernetesCluster], + List[_models.KubernetesVersion], deserialized.get("value", []), ) if cls: @@ -12816,10 +16797,15 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace + @api_version_validation( + method_added_on="2026-01-01-preview", + params_added_on={"2026-01-01-preview": ["api_version", "subscription_id", "top", "skip_token", "accept"]}, + api_versions_list=["2026-01-01-preview", "2026-05-01-preview"], + ) def list_by_subscription( self, *, top: Optional[int] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.KubernetesCluster"]: - """Get a list of Kubernetes clusters in the provided subscription. + ) -> ItemPaged["_models.KubernetesVersion"]: + """Get a list of Kubernetes version resources in the provided subscription. :keyword top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -12828,14 +16814,14 @@ def list_by_subscription( listing resources from. This is used for paging through large result sets. Default value is None. :paramtype skip_token: str - :return: An iterator like instance of KubernetesCluster - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.KubernetesCluster] + :return: An iterator like instance of KubernetesVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.networkcloud.models.KubernetesVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.KubernetesCluster]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.KubernetesVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12848,7 +16834,7 @@ def list_by_subscription( def prepare_request(next_link=None): if not next_link: - _request = build_kubernetes_clusters_list_by_subscription_request( + _request = build_kubernetes_versions_list_by_subscription_request( subscription_id=self._config.subscription_id, top=top, skip_token=skip_token, @@ -12888,7 +16874,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.KubernetesCluster], + List[_models.KubernetesVersion], deserialized.get("value", []), ) if cls: @@ -12916,249 +16902,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - def _restart_node_initial( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: Union[ - _models.KubernetesClusterRestartNodeParameters, 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(kubernetes_cluster_restart_node_parameters, (IOBase, bytes)): - _content = kubernetes_cluster_restart_node_parameters - else: - _content = json.dumps(kubernetes_cluster_restart_node_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_kubernetes_clusters_restart_node_request( - resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_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["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_restart_node( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: _models.KubernetesClusterRestartNodeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Restart a targeted node of a Kubernetes cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_restart_node_parameters: The request body. Required. - :type kubernetes_cluster_restart_node_parameters: - ~azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters - :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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_restart_node( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Restart a targeted node of a Kubernetes cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_restart_node_parameters: The request body. Required. - :type kubernetes_cluster_restart_node_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_restart_node( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Restart a targeted node of a Kubernetes cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_restart_node_parameters: The request body. Required. - :type kubernetes_cluster_restart_node_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 OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_restart_node( - self, - resource_group_name: str, - kubernetes_cluster_name: str, - kubernetes_cluster_restart_node_parameters: Union[ - _models.KubernetesClusterRestartNodeParameters, JSON, IO[bytes] - ], - **kwargs: Any - ) -> LROPoller[_models.OperationStatusResult]: - """Restart a targeted node of a Kubernetes cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param kubernetes_cluster_name: The name of the Kubernetes cluster. Required. - :type kubernetes_cluster_name: str - :param kubernetes_cluster_restart_node_parameters: The request body. Is one of the following - types: KubernetesClusterRestartNodeParameters, JSON, IO[bytes] Required. - :type kubernetes_cluster_restart_node_parameters: - ~azure.mgmt.networkcloud.models.KubernetesClusterRestartNodeParameters or JSON or IO[bytes] - :return: An instance of LROPoller that returns OperationStatusResult. The OperationStatusResult - is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.networkcloud.models.OperationStatusResult] - :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.OperationStatusResult] = 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._restart_node_initial( - resource_group_name=resource_group_name, - kubernetes_cluster_name=kubernetes_cluster_name, - kubernetes_cluster_restart_node_parameters=kubernetes_cluster_restart_node_parameters, - 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.OperationStatusResult, 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.OperationStatusResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OperationStatusResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - class L2NetworksOperations: """ diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_create_or_update.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_create_or_update.py new file mode 100644 index 000000000000..24e010eeab51 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_create_or_update.py @@ -0,0 +1,65 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python access_bridges_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.access_bridges.begin_create_or_update( + resource_group_name="resourceGroupName", + access_bridge_name="Bastion", + access_bridge={ + "extendedLocation": { + "name": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + "type": "CustomLocation", + }, + "location": "location", + "properties": { + "ipv4ConnectedPrefix": "198.51.100.0/24", + "ipv6ConnectedPrefix": "2001:db8::/64", + "networkId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName/internalNetworks/internalNetworkName", + "securityRules": [ + { + "description": "Allow management plane egress", + "direction": "Outbound", + "ipv4Addresses": ["10.10.20.10-10.10.20.20"], + "ipv6Addresses": ["2001:db8:abcd:12::1000-2001:db8:abcd:12::1fff"], + "port": "24562-24570", + } + ], + }, + "tags": {"key1": "myvalue1", "key2": "myvalue2"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/AccessBridges_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_delete.py new file mode 100644 index 000000000000..fe94ce54a51c --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_delete.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python access_bridges_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.access_bridges.begin_delete( + resource_group_name="resourceGroupName", + access_bridge_name="Bastion", + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/AccessBridges_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_get.py new file mode 100644 index 000000000000..112965ea9869 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_get.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python access_bridges_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.access_bridges.get( + resource_group_name="resourceGroupName", + access_bridge_name="Bastion", + ) + print(response) + + +# x-ms-original-file: 2026-05-01-preview/AccessBridges_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_list_by_resource_group.py new file mode 100644 index 000000000000..fee3ad4166e6 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_list_by_resource_group.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python access_bridges_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.access_bridges.list_by_resource_group( + resource_group_name="resourceGroupName", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-05-01-preview/AccessBridges_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_list_by_subscription.py new file mode 100644 index 000000000000..8e8883608548 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_list_by_subscription.py @@ -0,0 +1,40 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python access_bridges_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.access_bridges.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2026-05-01-preview/AccessBridges_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_patch.py new file mode 100644 index 000000000000..0c23bbf0dc2a --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/access_bridges_patch.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python access_bridges_patch.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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.access_bridges.begin_update( + resource_group_name="resourceGroupName", + access_bridge_name="Bastion", + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/AccessBridges_Patch.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_create.py index 1ca9933179c7..019db60365c5 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_create.py @@ -86,6 +86,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/AgentPools_Create.json +# x-ms-original-file: 2026-05-01-preview/AgentPools_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_delete.py index 242b8b5498c1..83e3f7b0b26b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_delete.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/AgentPools_Delete.json +# x-ms-original-file: 2026-05-01-preview/AgentPools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_get.py index 3aabce9f101c..3472ad404348 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/AgentPools_Get.json +# x-ms-original-file: 2026-05-01-preview/AgentPools_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_list_by_kubernetes_cluster.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_list_by_kubernetes_cluster.py index c00461fae94d..874e18d7d51e 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_list_by_kubernetes_cluster.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_list_by_kubernetes_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/AgentPools_ListByKubernetesCluster.json +# x-ms-original-file: 2026-05-01-preview/AgentPools_ListByKubernetesCluster.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_patch.py index d93c4af0ee1e..0c844eb61250 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/agent_pools_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/AgentPools_Patch.json +# x-ms-original-file: 2026-05-01-preview/AgentPools_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_create.py index 0d5be2f4b6cd..e3e819dfc371 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_create.py @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachineKeySets_Create.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachineKeySets_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_delete.py index efbf07ec7b3e..65e5a7dc429d 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_delete.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachineKeySets_Delete.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachineKeySets_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_get.py index 1a96f4f78bca..99d80da1ddc5 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachineKeySets_Get.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachineKeySets_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_list_by_cluster.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_list_by_cluster.py index f944a1ee28ae..737a11bec622 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_list_by_cluster.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_list_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/BareMetalMachineKeySets_ListByCluster.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachineKeySets_ListByCluster.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_patch.py index 16cc0b62ee13..91b91c32b084 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machine_key_sets_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachineKeySets_Patch.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachineKeySets_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_cordon.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_cordon.py index 54790e7ce01e..56405642e414 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_cordon.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_cordon.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Cordon.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Cordon.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_create.py index 8a86eeb91f05..a0ee38db87c0 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_create.py @@ -58,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Create.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_delete.py index 842059ac385b..bdaeacd97edd 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Delete.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_get.py index fafca7472bb6..83b8554f37d3 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Get.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_list_by_resource_group.py index bc4b79e2963b..735b9e23d7dd 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/BareMetalMachines_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_list_by_subscription.py index 2b93411c4516..14435b414aa2 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/BareMetalMachines_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_patch.py index 415b8a03a34c..1046b1bee9d2 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Patch.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_power_off.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_power_off.py index 31893ad7eabc..c5948393a4e5 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_power_off.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_power_off.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_PowerOff.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_PowerOff.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_reimage.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_reimage.py index 6cc44ae27e86..94e6255db8a8 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_reimage.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_reimage.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Reimage.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Reimage.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_replace.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_replace.py index 25e739ab449f..9097dc20ee20 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_replace.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_replace.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Replace.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Replace.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_restart.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_restart.py index 9e1554204044..32144a27e5e5 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_restart.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_restart.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Restart.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Restart.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_command.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_command.py index b16ab7cf33a1..b52b96df414e 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_command.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_command.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_RunCommand.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_RunCommand.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_data_extracts.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_data_extracts.py index 2b4b784fa389..311f67780130 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_data_extracts.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_data_extracts.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_RunDataExtracts.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_RunDataExtracts.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_data_extracts_restricted.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_data_extracts_restricted.py index 1b95ec41d443..bfb9a1572bd9 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_data_extracts_restricted.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_data_extracts_restricted.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_RunDataExtractsRestricted.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_RunDataExtractsRestricted.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_read_commands_hostname.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_read_commands_hostname.py index 5db8bc37789c..3edd812b8bf5 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_read_commands_hostname.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_read_commands_hostname.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_RunReadCommands_Hostname.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_RunReadCommands_Hostname.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_read_commands_multiple.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_read_commands_multiple.py index 8b3a3397770f..cb146c02b9bc 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_read_commands_multiple.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_run_read_commands_multiple.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_RunReadCommands_Multiple.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_RunReadCommands_Multiple.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_start.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_start.py index 2ffb0370b1b5..50fc9e5769a9 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_start.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_start.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Start.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Start.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_uncordon.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_uncordon.py index 554c3e3aad9f..2a2108814d8b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_uncordon.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bare_metal_machines_uncordon.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BareMetalMachines_Uncordon.json +# x-ms-original-file: 2026-05-01-preview/BareMetalMachines_Uncordon.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_create.py index e849ff8d3971..6ee30fe33dfa 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_create.py @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BmcKeySets_Create.json +# x-ms-original-file: 2026-05-01-preview/BmcKeySets_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_delete.py index e4dd3f513291..7fa7f1138ea2 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_delete.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BmcKeySets_Delete.json +# x-ms-original-file: 2026-05-01-preview/BmcKeySets_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_get.py index b625817c2fcc..2a8cbf833d4f 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BmcKeySets_Get.json +# x-ms-original-file: 2026-05-01-preview/BmcKeySets_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_list_by_cluster.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_list_by_cluster.py index 16ba1cb38864..8c917ac1ea51 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_list_by_cluster.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_list_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/BmcKeySets_ListByCluster.json +# x-ms-original-file: 2026-05-01-preview/BmcKeySets_ListByCluster.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_patch.py index 3047689bc16d..18737659324f 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/bmc_key_sets_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/BmcKeySets_Patch.json +# x-ms-original-file: 2026-05-01-preview/BmcKeySets_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_create.py index 3aa58eae72e2..b6f228990c39 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_create.py @@ -51,7 +51,7 @@ def main(): "storageOptions": { "mode": "Standard", "sizeMiB": 1048576, - "storageApplianceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/StorageAppliances/storageApplianceName", + "storageApplianceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName", }, }, "tags": {"key1": "myvalue1", "key2": "myvalue2"}, @@ -60,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/CloudServicesNetworks_Create.json +# x-ms-original-file: 2026-05-01-preview/CloudServicesNetworks_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_delete.py index 8488404d90e6..0b32ec72e40f 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/CloudServicesNetworks_Delete.json +# x-ms-original-file: 2026-05-01-preview/CloudServicesNetworks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_get.py index 8e921e2b9d10..000eac4baff7 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/CloudServicesNetworks_Get.json +# x-ms-original-file: 2026-05-01-preview/CloudServicesNetworks_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_list_by_resource_group.py index 464d2319f9cd..0a00f8aad52d 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/CloudServicesNetworks_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/CloudServicesNetworks_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_list_by_subscription.py index 4128ad4784aa..9da26937c526 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/CloudServicesNetworks_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/CloudServicesNetworks_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_patch.py index 077b5778b3d8..efe7d84e7fb4 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cloud_services_networks_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/CloudServicesNetworks_Patch.json +# x-ms-original-file: 2026-05-01-preview/CloudServicesNetworks_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_create.py index 4da584a16ac1..74b50a004e10 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_create.py @@ -36,9 +36,10 @@ def main(): cluster_manager_name="clusterManagerName", cluster_manager_parameters={ "identity": {"type": "SystemAssigned"}, + "kind": "AzureLocal", "location": "location", "properties": { - "analyticsWorkspaceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + "analyticsWorkspaceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.OperationalInsights/workspaces/logAnalyticsWorkspaceName", "fabricControllerId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName", "managedResourceGroupConfiguration": {"location": "East US", "name": "my-managed-rg"}, }, @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterManagers_Create.json +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_create_uami.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_create_uami.py index 7cacb0718907..c94afb37f423 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_create_uami.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_create_uami.py @@ -41,9 +41,10 @@ def main(): "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1": {} }, }, + "kind": "AzureLocal", "location": "location", "properties": { - "analyticsWorkspaceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + "analyticsWorkspaceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.OperationalInsights/workspaces/logAnalyticsWorkspaceName", "fabricControllerId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName", "managedResourceGroupConfiguration": {"location": "East US", "name": "my-managed-rg"}, }, @@ -53,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterManagers_Create_Uami.json +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_Create_Uami.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_delete.py index 2c225d4a28bd..a73db41953dd 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterManagers_Delete.json +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_get.py index cef697a3390a..1c79f29eff07 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterManagers_Get.json +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_list_by_resource_group.py index e74b17b6cf96..fc5554dbe0d0 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/ClusterManagers_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_list_by_subscription.py index 05170557c98b..244b2f87ade7 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/ClusterManagers_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_patch.py index f7a2ea4f0cd3..3ec09db40767 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterManagers_Patch.json +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_update_relay_private_endpoint_connection_approve.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_update_relay_private_endpoint_connection_approve.py new file mode 100644 index 000000000000..a14bb1d795e1 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_update_relay_private_endpoint_connection_approve.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python cluster_managers_update_relay_private_endpoint_connection_approve.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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.cluster_managers.begin_update_relay_private_endpoint_connection( + resource_group_name="resourceGroupName", + cluster_manager_name="clusterManagerName", + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_UpdateRelayPrivateEndpointConnection_Approve.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_update_relay_private_endpoint_connection_reject.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_update_relay_private_endpoint_connection_reject.py new file mode 100644 index 000000000000..3fe288d65fa9 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_managers_update_relay_private_endpoint_connection_reject.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python cluster_managers_update_relay_private_endpoint_connection_reject.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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.cluster_managers.begin_update_relay_private_endpoint_connection( + resource_group_name="resourceGroupName", + cluster_manager_name="clusterManagerName", + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/ClusterManagers_UpdateRelayPrivateEndpointConnection_Reject.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_create.py index c09d1d7431fb..cbeed8d4e63e 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_create.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterMetricsConfigurations_Create.json +# x-ms-original-file: 2026-05-01-preview/ClusterMetricsConfigurations_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_delete.py index 05774fbfd63e..6a8ea478cfce 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_delete.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterMetricsConfigurations_Delete.json +# x-ms-original-file: 2026-05-01-preview/ClusterMetricsConfigurations_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_get.py index dbe2effb860b..6e7be4e1cf3f 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterMetricsConfigurations_Get.json +# x-ms-original-file: 2026-05-01-preview/ClusterMetricsConfigurations_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_list_by_cluster.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_list_by_cluster.py index 9d85a97f0df1..ec0bf5daa266 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_list_by_cluster.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_list_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/ClusterMetricsConfigurations_ListByCluster.json +# x-ms-original-file: 2026-05-01-preview/ClusterMetricsConfigurations_ListByCluster.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_patch.py index f717fb1d771e..dc90db2d173b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/cluster_metrics_configurations_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/ClusterMetricsConfigurations_Patch.json +# x-ms-original-file: 2026-05-01-preview/ClusterMetricsConfigurations_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_continue_update_version.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_continue_update_version.py index 907238e73085..0e8af40619e9 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_continue_update_version.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_continue_update_version.py @@ -33,11 +33,11 @@ def main(): response = client.clusters.begin_continue_update_version( resource_group_name="resourceGroupName", cluster_name="clusterName", - cluster_continue_update_version_parameters={"machineGroupTargetingMode": "AlphaByRack"}, + cluster_continue_update_version_parameters={"machineGroupTargetingMode": "AlphaByRack", "safeguardMode": "All"}, ).result() print(response) -# x-ms-original-file: 2025-09-01/Clusters_ContinueUpdateVersion.json +# x-ms-original-file: 2026-05-01-preview/Clusters_ContinueUpdateVersion.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_create.py index b7648f448871..7b21df0a3f86 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_create.py @@ -45,6 +45,7 @@ def main(): "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1": {} }, }, + "kind": "AzureLocal", "location": "location", "properties": { "aggregatorOrSingleRackDefinition": { @@ -91,7 +92,7 @@ def main(): ], }, "analyticsOutputSettings": { - "analyticsWorkspaceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName", + "analyticsWorkspaceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.OperationalInsights/workspaces/logAnalyticsWorkspaceName", "associatedIdentity": { "identityType": "UserAssignedIdentity", "userAssignedIdentityResourceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userIdentity1", @@ -165,7 +166,7 @@ def main(): ], "managedResourceGroupConfiguration": {"location": "East US", "name": "my-managed-rg"}, "networkFabricId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName", - "runtimeProtectionConfiguration": {"enforcementLevel": "OnDemand"}, + "runtimeProtectionConfiguration": {"definitionUpdateMode": "None", "enforcementLevel": "OnDemand"}, "secretArchiveSettings": { "associatedIdentity": { "identityType": "UserAssignedIdentity", @@ -188,6 +189,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Create.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_delete.py index a789a88da815..f888d3410e48 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Delete.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_deploy.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_deploy.py index bb7199c41719..b0d16348fc72 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_deploy.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_deploy.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Deploy.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Deploy.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_deploy_skip_validation.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_deploy_skip_validation.py index 797951188c58..182cdf693286 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_deploy_skip_validation.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_deploy_skip_validation.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Deploy_SkipValidation.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Deploy_SkipValidation.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_get.py index 4526140462e5..988a4262fb14 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Get.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_inspect.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_inspect.py new file mode 100644 index 000000000000..d149d904da94 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_inspect.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python clusters_inspect.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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_inspect( + resource_group_name="resourceGroupName", + cluster_name="clusterName", + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/Clusters_Inspect.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_list_by_resource_group.py index 024f032fb0b8..7dfd9490a53b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/Clusters_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/Clusters_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_list_by_subscription.py index d5bf6e4edf54..45e0c72e4820 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/Clusters_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/Clusters_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_aggregator_or_single_rack_definition.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_aggregator_or_single_rack_definition.py index 4e8f499b0883..e870de2f4a18 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_aggregator_or_single_rack_definition.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_aggregator_or_single_rack_definition.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Patch_AggregatorOrSingleRackDefinition.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Patch_AggregatorOrSingleRackDefinition.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_analytics_output.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_analytics_output.py index deb09bb816e4..d3e37daa77fe 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_analytics_output.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_analytics_output.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Patch_AnalyticsOutput.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Patch_AnalyticsOutput.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_command_output.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_command_output.py index d72cd5d65bce..588900f76141 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_command_output.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_command_output.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Patch_CommandOutput.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Patch_CommandOutput.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_location.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_location.py index be88331771cf..cdf0cdd2c0f5 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_location.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_location.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Patch_Location.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Patch_Location.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_runtime_protection_configuration.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_runtime_protection_configuration.py index 9ba54e988cc9..dac19650517b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_runtime_protection_configuration.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_runtime_protection_configuration.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Patch_RuntimeProtectionConfiguration.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Patch_RuntimeProtectionConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_secret_archive.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_secret_archive.py index 19f017e6c3e4..707aebc404dc 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_secret_archive.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_secret_archive.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Patch_SecretArchive.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Patch_SecretArchive.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_update_strategy.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_update_strategy.py index b7e1e7b83538..5636a673307a 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_update_strategy.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_update_strategy.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Patch_UpdateStrategy.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Patch_UpdateStrategy.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_vulnerability_scanning.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_vulnerability_scanning.py index b958b4a4594f..f6fb0a90adc3 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_vulnerability_scanning.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_patch_vulnerability_scanning.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_Patch_VulnerabilityScanning.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Patch_VulnerabilityScanning.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_rotate_credential.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_rotate_credential.py new file mode 100644 index 000000000000..7a9d6f6a1898 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_rotate_credential.py @@ -0,0 +1,43 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python clusters_rotate_credential.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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_rotate_credential( + resource_group_name="resourceGroupName", + cluster_name="clusterName", + body={"credentials": ["BMC Credential"]}, + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/Clusters_RotateCredential.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_scan_runtime.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_scan_runtime.py index 06bcb31de243..73b277ee91df 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_scan_runtime.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_scan_runtime.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Clusters_ScanRuntime.json +# x-ms-original-file: 2026-05-01-preview/Clusters_ScanRuntime.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_update_version.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_update_version.py index a7a55496dae7..b7ceff336488 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_update_version.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/clusters_update_version.py @@ -33,11 +33,11 @@ def main(): response = client.clusters.begin_update_version( resource_group_name="resourceGroupName", cluster_name="clusterName", - cluster_update_version_parameters={"targetClusterVersion": "2.0"}, + cluster_update_version_parameters={"safeguardMode": "All", "targetClusterVersion": "2.0"}, ).result() print(response) -# x-ms-original-file: 2025-09-01/Clusters_UpdateVersion.json +# x-ms-original-file: 2026-05-01-preview/Clusters_UpdateVersion.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_create.py index 4b1f416e3d5e..35d3b3922906 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_create.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Consoles_Create.json +# x-ms-original-file: 2026-05-01-preview/Consoles_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_delete.py index c9d3c8ac3c5c..41a6a06ca4b4 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_delete.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Consoles_Delete.json +# x-ms-original-file: 2026-05-01-preview/Consoles_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_get.py index 10035812eef0..cfa5991bc2d6 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Consoles_Get.json +# x-ms-original-file: 2026-05-01-preview/Consoles_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_list_by_virtual_machine.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_list_by_virtual_machine.py index 34659cf12413..2eece7132b40 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_list_by_virtual_machine.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_list_by_virtual_machine.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/Consoles_ListByVirtualMachine.json +# x-ms-original-file: 2026-05-01-preview/Consoles_ListByVirtualMachine.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_patch.py index 364ff90c46c3..d244d70d6b27 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/consoles_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Consoles_Patch.json +# x-ms-original-file: 2026-05-01-preview/Consoles_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_create.py index fc4a62c609a8..f559b5fc91e5 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_create.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusterFeatures_Create.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusterFeatures_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_delete.py index f8460aeba19d..6b7c1a914417 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_delete.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusterFeatures_Delete.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusterFeatures_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_get.py index 47cba3efa4eb..3ca74764bbf7 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusterFeatures_Get.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusterFeatures_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_list_by_kubernetes_cluster.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_list_by_kubernetes_cluster.py index 653f13acc4ad..6c64a57a2170 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_list_by_kubernetes_cluster.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_list_by_kubernetes_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/KubernetesClusterFeatures_ListByKubernetesCluster.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusterFeatures_ListByKubernetesCluster.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_patch.py index ea77fcb5824c..04d4e4dac2c1 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_cluster_features_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusterFeatures_Patch.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusterFeatures_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_create.py index 7354719d2490..21bb955a662a 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_create.py @@ -174,6 +174,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusters_Create.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusters_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_delete.py index d001bfde286d..f025fbacde7a 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusters_Delete.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_get.py index 41499b2620fe..bc9b7becec03 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusters_Get.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusters_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_l2_load_balancer_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_l2_load_balancer_create.py index af19cc43a598..79b7351a56e8 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_l2_load_balancer_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_l2_load_balancer_create.py @@ -147,6 +147,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusters_L2LoadBalancer_Create.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusters_L2LoadBalancer_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_list_by_resource_group.py index 0ee8a0b5234d..bdc1b6da4cfa 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/KubernetesClusters_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusters_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_list_by_subscription.py index 97080cc088cb..a877a751db1f 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/KubernetesClusters_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusters_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_patch.py index 3b019256737a..a445f7d73eee 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusters_Patch.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusters_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_restart_node.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_restart_node.py index 98efd4e4dfda..9c1f41d004d2 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_restart_node.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_clusters_restart_node.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/KubernetesClusters_RestartNode.json +# x-ms-original-file: 2026-05-01-preview/KubernetesClusters_RestartNode.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_create.py new file mode 100644 index 000000000000..351b6a209fb4 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_create.py @@ -0,0 +1,52 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python kubernetes_versions_create.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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.kubernetes_versions.begin_create_or_update( + resource_group_name="resourceGroupName", + kubernetes_version_name="default", + kubernetes_version_parameters={ + "extendedLocation": { + "name": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName", + "type": "CustomLocation", + }, + "location": "location", + "properties": {}, + "tags": {"key1": "myvalue1", "key2": "myvalue2"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/KubernetesVersions_Create.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_delete.py new file mode 100644 index 000000000000..d6139c7e1c1e --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_delete.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python kubernetes_versions_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.kubernetes_versions.begin_delete( + resource_group_name="resourceGroupName", + kubernetes_version_name="default", + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/KubernetesVersions_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_get.py new file mode 100644 index 000000000000..9e2fd7bae19e --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_get.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python kubernetes_versions_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.kubernetes_versions.get( + resource_group_name="resourceGroupName", + kubernetes_version_name="default", + ) + print(response) + + +# x-ms-original-file: 2026-05-01-preview/KubernetesVersions_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_list_by_resource_group.py new file mode 100644 index 000000000000..cd408ceaf81d --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_list_by_resource_group.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python kubernetes_versions_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.kubernetes_versions.list_by_resource_group( + resource_group_name="resourceGroupName", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-05-01-preview/KubernetesVersions_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_list_by_subscription.py new file mode 100644 index 000000000000..7d647045e97a --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_list_by_subscription.py @@ -0,0 +1,40 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python kubernetes_versions_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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.kubernetes_versions.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2026-05-01-preview/KubernetesVersions_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_update_tags.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_update_tags.py new file mode 100644 index 000000000000..4d287d06a061 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/kubernetes_versions_update_tags.py @@ -0,0 +1,42 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-networkcloud +# USAGE + python kubernetes_versions_update_tags.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 = NetworkCloudMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.kubernetes_versions.begin_update( + resource_group_name="resourceGroupName", + kubernetes_version_name="default", + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/KubernetesVersions_UpdateTags.json +if __name__ == "__main__": + main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_create.py index 703c490df96e..8c24d573f9b0 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_create.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/L2Networks_Create.json +# x-ms-original-file: 2026-05-01-preview/L2Networks_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_delete.py index afbfbc511aaa..c69a00c74d39 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/L2Networks_Delete.json +# x-ms-original-file: 2026-05-01-preview/L2Networks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_get.py index 77517e71055f..fdccc58fd2f6 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/L2Networks_Get.json +# x-ms-original-file: 2026-05-01-preview/L2Networks_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_list_by_resource_group.py index 9fec92cd797c..e72e1ccfe953 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/L2Networks_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/L2Networks_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_list_by_subscription.py index 3d59ceb5aa7f..59f863e60e8c 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/L2Networks_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/L2Networks_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_patch.py index ba827f195b2f..b6d6013213ca 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l2_networks_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/L2Networks_Patch.json +# x-ms-original-file: 2026-05-01-preview/L2Networks_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_create.py index 410c9eaa94ac..15535ba1fec4 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_create.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/L3Networks_Create.json +# x-ms-original-file: 2026-05-01-preview/L3Networks_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_delete.py index 6b97f5db777a..2acf38d9ea59 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/L3Networks_Delete.json +# x-ms-original-file: 2026-05-01-preview/L3Networks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_get.py index f744d8211888..33dd39af2140 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/L3Networks_Get.json +# x-ms-original-file: 2026-05-01-preview/L3Networks_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_list_by_resource_group.py index bfb84911a1c2..6d7aa696bb23 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/L3Networks_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/L3Networks_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_list_by_subscription.py index 9eaf290ab92a..b5447a13b567 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/L3Networks_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/L3Networks_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_patch.py index 1882794fde9e..dc14a6fef8fc 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/l3_networks_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/L3Networks_Patch.json +# x-ms-original-file: 2026-05-01-preview/L3Networks_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/operations_list.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/operations_list.py index 431c47b4b468..f6b58ba08799 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/operations_list.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/Operations_List.json +# x-ms-original-file: 2026-05-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/rack_skus_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/rack_skus_get.py index fd5f8d4686bb..d4cea9285878 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/rack_skus_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/rack_skus_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/RackSkus_Get.json +# x-ms-original-file: 2026-05-01-preview/RackSkus_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/rack_skus_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/rack_skus_list_by_subscription.py index b51d090da444..bb212022904d 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/rack_skus_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/rack_skus_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/RackSkus_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/RackSkus_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_create.py index 769eaefea87c..19422147397b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_create.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Racks_Create.json +# x-ms-original-file: 2026-05-01-preview/Racks_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_delete.py index 1a9336b5ee91..35cb6760c936 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Racks_Delete.json +# x-ms-original-file: 2026-05-01-preview/Racks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_get.py index d695b18740ab..62985a7ed4a6 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Racks_Get.json +# x-ms-original-file: 2026-05-01-preview/Racks_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_list_by_resource_group.py index 83b1341606fd..aa2f0e75c139 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/Racks_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/Racks_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_list_by_subscription.py index cd56f08ba54c..41dbf9b7e292 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/Racks_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/Racks_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_patch.py index b7f237532f99..25251e23d3cb 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/racks_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Racks_Patch.json +# x-ms-original-file: 2026-05-01-preview/Racks_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_create.py index f5b5fdd54baa..da40850536ec 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_create.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/StorageAppliances_Create.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_delete.py index ed95947e58c1..9524015384e4 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/StorageAppliances_Delete.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_disable_remote_vendor_management.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_disable_remote_vendor_management.py index 76cec268dd7b..a1c37348ba8b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_disable_remote_vendor_management.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_disable_remote_vendor_management.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/StorageAppliances_DisableRemoteVendorManagement.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_DisableRemoteVendorManagement.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_enable_remote_vendor_management.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_enable_remote_vendor_management.py index cd626bb56d25..f578a96c4002 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_enable_remote_vendor_management.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_enable_remote_vendor_management.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/StorageAppliances_EnableRemoteVendorManagement.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_EnableRemoteVendorManagement.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_get.py index cf327a531150..603339228cb1 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/StorageAppliances_Get.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_list_by_resource_group.py index 445320eebee3..dcd1fca06317 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/StorageAppliances_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_list_by_subscription.py index e5d6346a1c38..1df42a9a9f07 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/StorageAppliances_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_patch.py index 88c881301f76..2211c784a744 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/StorageAppliances_Patch.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_run_read_commands.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_run_read_commands.py index 5f301c16f509..4f17b5d9bcb9 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_run_read_commands.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/storage_appliances_run_read_commands.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/StorageAppliances_RunReadCommands.json +# x-ms-original-file: 2026-05-01-preview/StorageAppliances_RunReadCommands.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_create.py index fd75e93fed26..a080fa5ba9c5 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_create.py @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/TrunkedNetworks_Create.json +# x-ms-original-file: 2026-05-01-preview/TrunkedNetworks_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_delete.py index c871f3701bfb..10d50bc35590 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/TrunkedNetworks_Delete.json +# x-ms-original-file: 2026-05-01-preview/TrunkedNetworks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_get.py index 1e0302a9891e..ba37d1801358 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/TrunkedNetworks_Get.json +# x-ms-original-file: 2026-05-01-preview/TrunkedNetworks_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_list_by_resource_group.py index e2bd051a117f..0c61ff61f227 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/TrunkedNetworks_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/TrunkedNetworks_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_list_by_subscription.py index 2ec4d4a42c49..d93be06ccb79 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/TrunkedNetworks_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/TrunkedNetworks_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_patch.py index c7dcfad08556..037f8ec8d8ac 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/trunked_networks_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/TrunkedNetworks_Patch.json +# x-ms-original-file: 2026-05-01-preview/TrunkedNetworks_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_assign_relay.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_assign_relay.py index 31cdbfb149a8..140c40816e4f 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_assign_relay.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_assign_relay.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_AssignRelay.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_AssignRelay.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_create.py index 1d0f3a347639..7812296d5937 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_create.py @@ -100,6 +100,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_Create.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_delete.py index cd0814f7bfcc..26d28a1a7110 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_Delete.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_get.py index 4312f556a49e..9f815d4c49f4 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_Get.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_list_by_resource_group.py index db8cadd5150f..06f524963f1d 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/VirtualMachines_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_list_by_subscription.py index 1df667055557..8dab5f172efa 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/VirtualMachines_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_patch.py index 9a2cedefe497..17d455582e92 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_Patch.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_power_off.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_power_off.py index c96d66f62a93..7bdad3dbcbb9 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_power_off.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_power_off.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_PowerOff.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_PowerOff.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_reimage.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_reimage.py index f10882284acf..301c79be4d1f 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_reimage.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_reimage.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_Reimage.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_Reimage.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_restart.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_restart.py index f482732e7a22..ccd7731758aa 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_restart.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_restart.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_Restart.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_Restart.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_start.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_start.py index df0cbdb2cef1..3e962e72e58f 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_start.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/virtual_machines_start.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/VirtualMachines_Start.json +# x-ms-original-file: 2026-05-01-preview/VirtualMachines_Start.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_create.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_create.py index 2b2a7e7a8a77..e2670825aa15 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_create.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_create.py @@ -42,7 +42,7 @@ def main(): "location": "location", "properties": { "sizeMiB": 1048576, - "storageApplianceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/StorageAppliances/storageApplianceName", + "storageApplianceId": "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/storageAppliances/storageApplianceName", }, "tags": {"key1": "myvalue1", "key2": "myvalue2"}, }, @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Volumes_Create.json +# x-ms-original-file: 2026-05-01-preview/Volumes_Create.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_delete.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_delete.py index 8c669b34d91d..0d4301b99943 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_delete.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Volumes_Delete.json +# x-ms-original-file: 2026-05-01-preview/Volumes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_get.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_get.py index ae442c7fe77c..d335c3e890c7 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_get.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Volumes_Get.json +# x-ms-original-file: 2026-05-01-preview/Volumes_Get.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_list_by_resource_group.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_list_by_resource_group.py index ada7a02a7194..c2bab273fed8 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_list_by_resource_group.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/Volumes_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/Volumes_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_list_by_subscription.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_list_by_subscription.py index 50418a9cb0f3..1c6a8fedc802 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_list_by_subscription.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-09-01/Volumes_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/Volumes_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_patch.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_patch.py index 542e37a68039..166c6933e53e 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_patch.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_samples/volumes_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-09-01/Volumes_Patch.json +# x-ms-original-file: 2026-05-01-preview/Volumes_Patch.json if __name__ == "__main__": main() diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_access_bridges_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_access_bridges_operations.py new file mode 100644 index 000000000000..e733e2ea2eb0 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_access_bridges_operations.py @@ -0,0 +1,117 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +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 TestNetworkCloudMgmtAccessBridgesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(NetworkCloudMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_bridges_get(self, resource_group): + response = self.client.access_bridges.get( + resource_group_name=resource_group.name, + access_bridge_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_access_bridges_begin_create_or_update(self, resource_group): + response = self.client.access_bridges.begin_create_or_update( + resource_group_name=resource_group.name, + access_bridge_name="str", + access_bridge={ + "extendedLocation": {"name": "str", "type": "str"}, + "location": "str", + "properties": { + "networkId": "str", + "detailedStatus": "str", + "detailedStatusMessage": "str", + "endpoints": [{"fqdn": "str", "ipv4Address": "str", "ipv6Address": "str", "name": "str"}], + "ipv4ConnectedPrefix": "str", + "ipv6ConnectedPrefix": "str", + "protocol": "str", + "provisioningState": "str", + "securityRules": [ + { + "direction": "str", + "port": "str", + "description": "str", + "ipv4Addresses": ["str"], + "ipv6Addresses": ["str"], + } + ], + }, + "etag": "str", + "id": "str", + "name": "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_access_bridges_begin_update(self, resource_group): + response = self.client.access_bridges.begin_update( + resource_group_name=resource_group.name, + access_bridge_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_access_bridges_begin_delete(self, resource_group): + response = self.client.access_bridges.begin_delete( + resource_group_name=resource_group.name, + access_bridge_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_access_bridges_list_by_resource_group(self, resource_group): + response = self.client.access_bridges.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_access_bridges_list_by_subscription(self, resource_group): + response = self.client.access_bridges.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_access_bridges_operations_async.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_access_bridges_operations_async.py new file mode 100644 index 000000000000..62ee438dab18 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_access_bridges_operations_async.py @@ -0,0 +1,124 @@ +# 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.networkcloud.aio import NetworkCloudMgmtClient + +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 TestNetworkCloudMgmtAccessBridgesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(NetworkCloudMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_bridges_get(self, resource_group): + response = await self.client.access_bridges.get( + resource_group_name=resource_group.name, + access_bridge_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_access_bridges_begin_create_or_update(self, resource_group): + response = await ( + await self.client.access_bridges.begin_create_or_update( + resource_group_name=resource_group.name, + access_bridge_name="str", + access_bridge={ + "extendedLocation": {"name": "str", "type": "str"}, + "location": "str", + "properties": { + "networkId": "str", + "detailedStatus": "str", + "detailedStatusMessage": "str", + "endpoints": [{"fqdn": "str", "ipv4Address": "str", "ipv6Address": "str", "name": "str"}], + "ipv4ConnectedPrefix": "str", + "ipv6ConnectedPrefix": "str", + "protocol": "str", + "provisioningState": "str", + "securityRules": [ + { + "direction": "str", + "port": "str", + "description": "str", + "ipv4Addresses": ["str"], + "ipv6Addresses": ["str"], + } + ], + }, + "etag": "str", + "id": "str", + "name": "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_access_bridges_begin_update(self, resource_group): + response = await ( + await self.client.access_bridges.begin_update( + resource_group_name=resource_group.name, + access_bridge_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_access_bridges_begin_delete(self, resource_group): + response = await ( + await self.client.access_bridges.begin_delete( + resource_group_name=resource_group.name, + access_bridge_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_access_bridges_list_by_resource_group(self, resource_group): + response = self.client.access_bridges.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_access_bridges_list_by_subscription(self, resource_group): + response = self.client.access_bridges.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_bare_metal_machines_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_bare_metal_machines_operations.py index 397eea1d761c..22f687def255 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_bare_metal_machines_operations.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_bare_metal_machines_operations.py @@ -69,6 +69,8 @@ def test_bare_metal_machines_begin_create_or_update(self, resource_group): } ], "associatedResourceIds": ["str"], + "bmcIpv4Address": "str", + "bmcIpv6Address": "str", "caCertificate": {"hash": "str", "value": "str"}, "clusterId": "str", "cordonStatus": "str", @@ -98,6 +100,7 @@ def test_bare_metal_machines_begin_create_or_update(self, resource_group): "kubernetesVersion": "str", "machineClusterVersion": "str", "machineRoles": ["str"], + "monitoringConfigurationStatus": {"logLevel": "str", "metricsLevel": "str"}, "oamIpv4Address": "str", "oamIpv6Address": "str", "osImage": "str", @@ -105,8 +108,13 @@ def test_bare_metal_machines_begin_create_or_update(self, resource_group): "provisioningState": "str", "readyState": "str", "runtimeProtectionStatus": { + "agentHealthStatus": "str", + "agentHealthStatusIssues": ["str"], + "agentLicenseStatus": "str", + "definitionUpdateMode": "str", "definitionsLastUpdated": "2020-02-20 00:00:00", "definitionsVersion": "str", + "enforcementLevel": "str", "scanCompletedTime": "2020-02-20 00:00:00", "scanScheduledTime": "2020-02-20 00:00:00", "scanStartedTime": "2020-02-20 00:00:00", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_bare_metal_machines_operations_async.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_bare_metal_machines_operations_async.py index 83c32aff837a..2d410202dd59 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_bare_metal_machines_operations_async.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_bare_metal_machines_operations_async.py @@ -71,6 +71,8 @@ async def test_bare_metal_machines_begin_create_or_update(self, resource_group): } ], "associatedResourceIds": ["str"], + "bmcIpv4Address": "str", + "bmcIpv6Address": "str", "caCertificate": {"hash": "str", "value": "str"}, "clusterId": "str", "cordonStatus": "str", @@ -100,6 +102,7 @@ async def test_bare_metal_machines_begin_create_or_update(self, resource_group): "kubernetesVersion": "str", "machineClusterVersion": "str", "machineRoles": ["str"], + "monitoringConfigurationStatus": {"logLevel": "str", "metricsLevel": "str"}, "oamIpv4Address": "str", "oamIpv6Address": "str", "osImage": "str", @@ -107,8 +110,13 @@ async def test_bare_metal_machines_begin_create_or_update(self, resource_group): "provisioningState": "str", "readyState": "str", "runtimeProtectionStatus": { + "agentHealthStatus": "str", + "agentHealthStatusIssues": ["str"], + "agentLicenseStatus": "str", + "definitionUpdateMode": "str", "definitionsLastUpdated": "2020-02-20 00:00:00", "definitionsVersion": "str", + "enforcementLevel": "str", "scanCompletedTime": "2020-02-20 00:00:00", "scanScheduledTime": "2020-02-20 00:00:00", "scanStartedTime": "2020-02-20 00:00:00", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_cluster_managers_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_cluster_managers_operations.py index 6dffeafeb92c..348903bebdae 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_cluster_managers_operations.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_cluster_managers_operations.py @@ -47,6 +47,7 @@ def test_cluster_managers_begin_create_or_update(self, resource_group): "managedResourceGroupConfiguration": {"location": "str", "name": "str"}, "managerExtendedLocation": {"name": "str", "type": "str"}, "provisioningState": "str", + "relayConfiguration": {"relayNamespaceId": "str"}, "vmSize": "str", }, "etag": "str", @@ -57,6 +58,7 @@ def test_cluster_managers_begin_create_or_update(self, resource_group): "tenantId": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, + "kind": "str", "name": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -113,3 +115,14 @@ def test_cluster_managers_list_by_subscription(self, resource_group): result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cluster_managers_begin_update_relay_private_endpoint_connection(self, resource_group): + response = self.client.cluster_managers.begin_update_relay_private_endpoint_connection( + resource_group_name=resource_group.name, + cluster_manager_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_cluster_managers_operations_async.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_cluster_managers_operations_async.py index 535d5fbcf7cd..02d2222fefed 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_cluster_managers_operations_async.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_cluster_managers_operations_async.py @@ -49,6 +49,7 @@ async def test_cluster_managers_begin_create_or_update(self, resource_group): "managedResourceGroupConfiguration": {"location": "str", "name": "str"}, "managerExtendedLocation": {"name": "str", "type": "str"}, "provisioningState": "str", + "relayConfiguration": {"relayNamespaceId": "str"}, "vmSize": "str", }, "etag": "str", @@ -59,6 +60,7 @@ async def test_cluster_managers_begin_create_or_update(self, resource_group): "tenantId": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, + "kind": "str", "name": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -118,3 +120,16 @@ async def test_cluster_managers_list_by_subscription(self, resource_group): 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_cluster_managers_begin_update_relay_private_endpoint_connection(self, resource_group): + response = await ( + await self.client.cluster_managers.begin_update_relay_private_endpoint_connection( + resource_group_name=resource_group.name, + cluster_manager_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_clusters_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_clusters_operations.py index fc8cc3bb6664..26d085296920 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_clusters_operations.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_clusters_operations.py @@ -168,10 +168,12 @@ def test_clusters_begin_create_or_update(self, resource_group): "detailedStatus": "str", "detailedStatusMessage": "str", "hybridAksExtendedLocation": {"name": "str", "type": "str"}, + "lastSuccessfulVersionUpdateTime": "2020-02-20 00:00:00", + "managedCredentials": ["str"], "managedResourceGroupConfiguration": {"location": "str", "name": "str"}, "manualActionCount": 0, "provisioningState": "str", - "runtimeProtectionConfiguration": {"enforcementLevel": "str"}, + "runtimeProtectionConfiguration": {"definitionUpdateMode": "str", "enforcementLevel": "str"}, "secretArchive": {"keyVaultId": "str", "useKeyVault": "str"}, "secretArchiveSettings": { "associatedIdentity": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, @@ -196,6 +198,7 @@ def test_clusters_begin_create_or_update(self, resource_group): "tenantId": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, + "kind": "str", "name": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -259,7 +262,7 @@ def test_clusters_begin_continue_update_version(self, resource_group): response = self.client.clusters.begin_continue_update_version( resource_group_name=resource_group.name, cluster_name="str", - cluster_continue_update_version_parameters={"machineGroupTargetingMode": "str"}, + cluster_continue_update_version_parameters={"machineGroupTargetingMode": "str", "safeguardMode": "str"}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -276,6 +279,29 @@ def test_clusters_begin_deploy(self, resource_group): # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_begin_inspect(self, resource_group): + response = self.client.clusters.begin_inspect( + resource_group_name=resource_group.name, + cluster_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_clusters_begin_rotate_credential(self, resource_group): + response = self.client.clusters.begin_rotate_credential( + resource_group_name=resource_group.name, + cluster_name="str", + body={"credentials": ["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_scan_runtime(self, resource_group): @@ -293,7 +319,7 @@ def test_clusters_begin_update_version(self, resource_group): response = self.client.clusters.begin_update_version( resource_group_name=resource_group.name, cluster_name="str", - cluster_update_version_parameters={"targetClusterVersion": "str"}, + cluster_update_version_parameters={"targetClusterVersion": "str", "safeguardMode": "str"}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_clusters_operations_async.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_clusters_operations_async.py index deb11be0a0fc..d2ddcd1a6c53 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_clusters_operations_async.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_clusters_operations_async.py @@ -173,10 +173,12 @@ async def test_clusters_begin_create_or_update(self, resource_group): "detailedStatus": "str", "detailedStatusMessage": "str", "hybridAksExtendedLocation": {"name": "str", "type": "str"}, + "lastSuccessfulVersionUpdateTime": "2020-02-20 00:00:00", + "managedCredentials": ["str"], "managedResourceGroupConfiguration": {"location": "str", "name": "str"}, "manualActionCount": 0, "provisioningState": "str", - "runtimeProtectionConfiguration": {"enforcementLevel": "str"}, + "runtimeProtectionConfiguration": {"definitionUpdateMode": "str", "enforcementLevel": "str"}, "secretArchive": {"keyVaultId": "str", "useKeyVault": "str"}, "secretArchiveSettings": { "associatedIdentity": {"identityType": "str", "userAssignedIdentityResourceId": "str"}, @@ -201,6 +203,7 @@ async def test_clusters_begin_create_or_update(self, resource_group): "tenantId": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, + "kind": "str", "name": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -270,7 +273,7 @@ async def test_clusters_begin_continue_update_version(self, resource_group): await self.client.clusters.begin_continue_update_version( resource_group_name=resource_group.name, cluster_name="str", - cluster_continue_update_version_parameters={"machineGroupTargetingMode": "str"}, + cluster_continue_update_version_parameters={"machineGroupTargetingMode": "str", "safeguardMode": "str"}, ) ).result() # call '.result()' to poll until service return final result @@ -290,6 +293,33 @@ async def test_clusters_begin_deploy(self, resource_group): # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_begin_inspect(self, resource_group): + response = await ( + await self.client.clusters.begin_inspect( + resource_group_name=resource_group.name, + cluster_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_clusters_begin_rotate_credential(self, resource_group): + response = await ( + await self.client.clusters.begin_rotate_credential( + resource_group_name=resource_group.name, + cluster_name="str", + body={"credentials": ["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_scan_runtime(self, resource_group): @@ -310,7 +340,7 @@ async def test_clusters_begin_update_version(self, resource_group): await self.client.clusters.begin_update_version( resource_group_name=resource_group.name, cluster_name="str", - cluster_update_version_parameters={"targetClusterVersion": "str"}, + cluster_update_version_parameters={"targetClusterVersion": "str", "safeguardMode": "str"}, ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_kubernetes_versions_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_kubernetes_versions_operations.py new file mode 100644 index 000000000000..4c710d5e43c3 --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_kubernetes_versions_operations.py @@ -0,0 +1,99 @@ +# 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.networkcloud import NetworkCloudMgmtClient + +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 TestNetworkCloudMgmtKubernetesVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(NetworkCloudMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_kubernetes_versions_get(self, resource_group): + response = self.client.kubernetes_versions.get( + resource_group_name=resource_group.name, + kubernetes_version_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_kubernetes_versions_begin_create_or_update(self, resource_group): + response = self.client.kubernetes_versions.begin_create_or_update( + resource_group_name=resource_group.name, + kubernetes_version_name="str", + kubernetes_version_parameters={ + "extendedLocation": {"name": "str", "type": "str"}, + "location": "str", + "properties": {"provisioningState": "str", "values": [{"description": "str", "version": "str"}]}, + "etag": "str", + "id": "str", + "name": "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_kubernetes_versions_begin_update(self, resource_group): + response = self.client.kubernetes_versions.begin_update( + resource_group_name=resource_group.name, + kubernetes_version_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_kubernetes_versions_begin_delete(self, resource_group): + response = self.client.kubernetes_versions.begin_delete( + resource_group_name=resource_group.name, + kubernetes_version_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_kubernetes_versions_list_by_resource_group(self, resource_group): + response = self.client.kubernetes_versions.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_kubernetes_versions_list_by_subscription(self, resource_group): + response = self.client.kubernetes_versions.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_kubernetes_versions_operations_async.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_kubernetes_versions_operations_async.py new file mode 100644 index 000000000000..a331f568438b --- /dev/null +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_kubernetes_versions_operations_async.py @@ -0,0 +1,106 @@ +# 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.networkcloud.aio import NetworkCloudMgmtClient + +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 TestNetworkCloudMgmtKubernetesVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(NetworkCloudMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_kubernetes_versions_get(self, resource_group): + response = await self.client.kubernetes_versions.get( + resource_group_name=resource_group.name, + kubernetes_version_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_kubernetes_versions_begin_create_or_update(self, resource_group): + response = await ( + await self.client.kubernetes_versions.begin_create_or_update( + resource_group_name=resource_group.name, + kubernetes_version_name="str", + kubernetes_version_parameters={ + "extendedLocation": {"name": "str", "type": "str"}, + "location": "str", + "properties": {"provisioningState": "str", "values": [{"description": "str", "version": "str"}]}, + "etag": "str", + "id": "str", + "name": "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_kubernetes_versions_begin_update(self, resource_group): + response = await ( + await self.client.kubernetes_versions.begin_update( + resource_group_name=resource_group.name, + kubernetes_version_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_kubernetes_versions_begin_delete(self, resource_group): + response = await ( + await self.client.kubernetes_versions.begin_delete( + resource_group_name=resource_group.name, + kubernetes_version_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_kubernetes_versions_list_by_resource_group(self, resource_group): + response = self.client.kubernetes_versions.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_kubernetes_versions_list_by_subscription(self, resource_group): + response = self.client.kubernetes_versions.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_storage_appliances_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_storage_appliances_operations.py index 8ffe181cc344..83de72b96d0b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_storage_appliances_operations.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_storage_appliances_operations.py @@ -50,9 +50,11 @@ def test_storage_appliances_begin_create_or_update(self, resource_group): "clusterId": "str", "detailedStatus": "str", "detailedStatusMessage": "str", + "expansionShelves": [{"model": "str", "version": "str"}], "managementIpv4Address": "str", "manufacturer": "str", "model": "str", + "monitoringConfigurationStatus": {"logLevel": "str", "metricsLevel": "str"}, "provisioningState": "str", "remoteVendorManagementFeature": "str", "remoteVendorManagementStatus": "str", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_storage_appliances_operations_async.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_storage_appliances_operations_async.py index e74d6c939e9f..bfa46b3e6631 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_storage_appliances_operations_async.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_storage_appliances_operations_async.py @@ -52,9 +52,11 @@ async def test_storage_appliances_begin_create_or_update(self, resource_group): "clusterId": "str", "detailedStatus": "str", "detailedStatusMessage": "str", + "expansionShelves": [{"model": "str", "version": "str"}], "managementIpv4Address": "str", "manufacturer": "str", "model": "str", + "monitoringConfigurationStatus": {"logLevel": "str", "metricsLevel": "str"}, "provisioningState": "str", "remoteVendorManagementFeature": "str", "remoteVendorManagementStatus": "str", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_volumes_operations.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_volumes_operations.py index 6f5b27456406..26406a136a8b 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_volumes_operations.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_volumes_operations.py @@ -41,6 +41,7 @@ def test_volumes_begin_create_or_update(self, resource_group): "properties": { "sizeMiB": 0, "allocatedSizeMiB": 0, + "assignedStorageApplianceId": "str", "attachedTo": ["str"], "detailedStatus": "str", "detailedStatusMessage": "str", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_volumes_operations_async.py b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_volumes_operations_async.py index 6ecd15aaa83b..23435d2a785d 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_volumes_operations_async.py +++ b/sdk/networkcloud/azure-mgmt-networkcloud/generated_tests/test_network_cloud_mgmt_volumes_operations_async.py @@ -43,6 +43,7 @@ async def test_volumes_begin_create_or_update(self, resource_group): "properties": { "sizeMiB": 0, "allocatedSizeMiB": 0, + "assignedStorageApplianceId": "str", "attachedTo": ["str"], "detailedStatus": "str", "detailedStatusMessage": "str", diff --git a/sdk/networkcloud/azure-mgmt-networkcloud/tsp-location.yaml b/sdk/networkcloud/azure-mgmt-networkcloud/tsp-location.yaml index 41c926b7fb5c..3cb63bbddd40 100644 --- a/sdk/networkcloud/azure-mgmt-networkcloud/tsp-location.yaml +++ b/sdk/networkcloud/azure-mgmt-networkcloud/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/networkcloud/NetworkCloud.Management -commit: 0b5796a12cf5dca2f6b8ec3dce4566806497986c +commit: 13c2dbb75b6428e8a8e0751e40fe1e3dbc453d8b repo: Azure/azure-rest-api-specs additionalDirectories: